Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorSandy Armstrong <sandy@xamarin.com>2019-09-11 01:57:01 +0300
committerSandy Armstrong <sandy@xamarin.com>2019-09-18 19:23:09 +0300
commita02b67d36d9d3203abe0b9cbbcae88b73b751aae (patch)
treec135482d6af9c3d529af57dad948e360cdf928ad /main
parentfa0fac3a5eed1acc5fb1b903e273d3c85eb3526d (diff)
Fix: Remove all users of EnableNewEditor preferences
Diffstat (limited to 'main')
-rw-r--r--main/src/addins/MonoDevelop.TextEditor/MonoDevelop.TextEditor/CSharpEnableNewEditorSwitchController.cs44
-rw-r--r--main/src/addins/MonoDevelop.TextEditor/MonoDevelop.TextEditor/EditorCommandHandlers.cs41
-rw-r--r--main/src/addins/MonoDevelop.TextEditor/MonoDevelop.TextEditor/Properties/MonoDevelop.TextEditor.addin.xml5
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Composition/EditorExperimentationServiceInternal.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/DefaultSourceEditorOptions.cs49
5 files changed, 1 insertions, 140 deletions
diff --git a/main/src/addins/MonoDevelop.TextEditor/MonoDevelop.TextEditor/CSharpEnableNewEditorSwitchController.cs b/main/src/addins/MonoDevelop.TextEditor/MonoDevelop.TextEditor/CSharpEnableNewEditorSwitchController.cs
deleted file mode 100644
index 8d5fbd8090..0000000000
--- a/main/src/addins/MonoDevelop.TextEditor/MonoDevelop.TextEditor/CSharpEnableNewEditorSwitchController.cs
+++ /dev/null
@@ -1,44 +0,0 @@
-//
-// CSharpEnableNewEditorSwitchController.cs
-//
-// Author:
-// Jérémie Laval <jelaval@microsoft.com>
-//
-// Copyright (c) 2019 Microsoft, Inc.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using MonoDevelop.Core.FeatureConfiguration;
-using MonoDevelop.Ide.Editor;
-
-namespace MonoDevelop.TextEditor
-{
- sealed class CSharpEnableNewEditorSwitchController : IFeatureSwitchController
- {
- const string FeatureName = "CSharpEnableNewEditor";
-
- public bool? IsFeatureEnabled (string featureName)
- {
- if (!string.Equals (featureName, FeatureName, StringComparison.Ordinal))
- return null;
- return DefaultSourceEditorOptions.Instance.EnableNewEditor;
- }
- }
-}
diff --git a/main/src/addins/MonoDevelop.TextEditor/MonoDevelop.TextEditor/EditorCommandHandlers.cs b/main/src/addins/MonoDevelop.TextEditor/MonoDevelop.TextEditor/EditorCommandHandlers.cs
index e1a6298a58..d410381f1b 100644
--- a/main/src/addins/MonoDevelop.TextEditor/MonoDevelop.TextEditor/EditorCommandHandlers.cs
+++ b/main/src/addins/MonoDevelop.TextEditor/MonoDevelop.TextEditor/EditorCommandHandlers.cs
@@ -76,12 +76,6 @@ namespace MonoDevelop.TextEditor.Cocoa
ICommandHandler<WordDeleteToEndCommandArgs>,
ICommandHandler<WordDeleteToStartCommandArgs>,
ICommandHandler<FindReferencesCommandArgs>
-#if !WINDOWS
- ,
- ICommandHandler<ProvideEditorFeedbackCommandArgs>,
- ICommandHandler<DisableEditorPreviewCommandArgs>,
- ICommandHandler<LearnAboutTheEditorCommandArgs>
-#endif
{
[Import]
private IEditorOperationsFactoryService OperationsService { get; set; }
@@ -475,40 +469,5 @@ namespace MonoDevelop.TextEditor.Cocoa
GetOperations(args.TextView).DeleteToBeginningOfLine();
return true;
}
-
- #region Preview Editor Commands
-
-#if !WINDOWS
-
- CommandState ICommandHandler<ProvideEditorFeedbackCommandArgs>.GetCommandState (ProvideEditorFeedbackCommandArgs args)
- => CommandState.Available;
-
- bool ICommandHandler<ProvideEditorFeedbackCommandArgs>.ExecuteCommand (ProvideEditorFeedbackCommandArgs args, CommandExecutionContext executionContext)
- {
- IdeServices.DesktopService.ShowUrl ("https://aka.ms/vs/mac/editor/report-problem");
- return true;
- }
-
- CommandState ICommandHandler<LearnAboutTheEditorCommandArgs>.GetCommandState (LearnAboutTheEditorCommandArgs args)
- => CommandState.Available;
-
- bool ICommandHandler<LearnAboutTheEditorCommandArgs>.ExecuteCommand (LearnAboutTheEditorCommandArgs args, CommandExecutionContext executionContext)
- {
- IdeServices.DesktopService.ShowUrl ("https://aka.ms/vs/mac/editor/learn-more");
- return true;
- }
-
- CommandState ICommandHandler<DisableEditorPreviewCommandArgs>.GetCommandState (DisableEditorPreviewCommandArgs args)
- => CommandState.Available;
-
- bool ICommandHandler<DisableEditorPreviewCommandArgs>.ExecuteCommand (DisableEditorPreviewCommandArgs args, CommandExecutionContext executionContext)
- {
- DefaultSourceEditorOptions.Instance.EnableNewEditor = false;
- return true;
- }
-
-#endif
-
-#endregion
}
}
diff --git a/main/src/addins/MonoDevelop.TextEditor/MonoDevelop.TextEditor/Properties/MonoDevelop.TextEditor.addin.xml b/main/src/addins/MonoDevelop.TextEditor/MonoDevelop.TextEditor/Properties/MonoDevelop.TextEditor.addin.xml
index 08b355ce44..184055099d 100644
--- a/main/src/addins/MonoDevelop.TextEditor/MonoDevelop.TextEditor/Properties/MonoDevelop.TextEditor.addin.xml
+++ b/main/src/addins/MonoDevelop.TextEditor/MonoDevelop.TextEditor/Properties/MonoDevelop.TextEditor.addin.xml
@@ -63,11 +63,6 @@
<Assembly file="MonoDevelop.TextEditor.dll"/>
</Extension>
-
- <Extension path="/MonoDevelop/Core/FeatureConfiguration/FeatureSwitchChecks">
- <Type id="CSharpEnableNewEditor" class="MonoDevelop.TextEditor.CSharpEnableNewEditorSwitchController" />
- </Extension>
-
<Extension path="/MonoDevelop/Ide/Commands">
<Category _name="Text Editor" id="TextEditor">
<Command id="MonoDevelop.Ide.Commands.TextEditorCommands.InsertNextMatchingCaret"
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Composition/EditorExperimentationServiceInternal.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Composition/EditorExperimentationServiceInternal.cs
index e5df97fb31..96ccc81050 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Composition/EditorExperimentationServiceInternal.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Composition/EditorExperimentationServiceInternal.cs
@@ -10,6 +10,6 @@ namespace MonoDevelop.Ide.Composition
internal class EditorExperimentationServiceInternal : IExperimentationServiceInternal
{
public bool IsCachedFlightEnabled (string flightName)
- => flightName == "CompletionAPI" && DefaultSourceEditorOptions.Instance.EnableNewEditor;
+ => flightName == "CompletionAPI";
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/DefaultSourceEditorOptions.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/DefaultSourceEditorOptions.cs
index 423df40252..cc9805e70f 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/DefaultSourceEditorOptions.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/DefaultSourceEditorOptions.cs
@@ -402,55 +402,6 @@ namespace MonoDevelop.Ide.Editor
}
}
- ConfigurationProperty<bool> preferLegacyEditor = ConfigurationProperty.Create ("PreferLegacyEditor", false);
- public bool EnableNewEditor {
- // NOTE: as we're making this editor the default, we've switched to a new configuration property,
- // and we'll simply flip the value that we're getting from that. The code below might be a bit convoluted,
- // but it means we don't have additional changes
- get {
- return !preferLegacyEditor;
- }
- set {
- value = !value; //see notes above
- if (!preferLegacyEditor.Set (value))
- return;
-
- string messageText;
-
- if (!value) {
- messageText = GettextCatalog.GetString (
- "The modern editor has been enabled, but already opened files " +
- "will need to be closed and re-opened for the change to take effect.");
- Counters.NewEditorEnabled.Inc ();
- } else {
- messageText = GettextCatalog.GetString (
- "The legacy editor has been enabled, but already opened files " +
- "will need to be closed and re-opened for the change to take effect.");
- Counters.NewEditorDisabled.Inc ();
- }
-
- if (IdeApp.Workbench?.Documents?.Count > 0) {
- Gtk.Application.Invoke ((o, e) => {
- var closeAllFilesButton = new AlertButton (GettextCatalog.GetString ("Close All Files"));
-
- var message = new MessageDescription {
- Text = messageText
- };
-
- message.Buttons.Add (closeAllFilesButton);
- message.Buttons.Add (AlertButton.Ok);
- message.DefaultButton = 1;
-
- if (new AlertDialog (message).Run () == closeAllFilesButton)
- IdeApp.Workbench.CloseAllDocuments (false);
- });
- }
-
- OnChanged (EventArgs.Empty);
- }
- }
-
-
// TODO: Windows equivalent?
ConfigurationProperty<bool> enableSemanticHighlighting = ConfigurationProperty.Create ("EnableSemanticHighlighting", true);
public bool EnableSemanticHighlighting {