diff options
author | Lluis Sanchez <llsan@microsoft.com> | 2017-08-22 12:21:07 +0300 |
---|---|---|
committer | Lluis Sanchez <llsan@microsoft.com> | 2017-08-22 12:21:32 +0300 |
commit | 4bfb0213ee24b62311d6ed8035423427567a7b85 (patch) | |
tree | a04da37f1adc4c824795224c57b99327b917aef6 /main | |
parent | 51dd32084337dc0161cbd3b8320b447d4bc5f977 (diff) |
Fix warnings in MD.Ide
Diffstat (limited to 'main')
34 files changed, 89 insertions, 144 deletions
diff --git a/main/src/core/Mono.TextEditor.Platform/PlatformCatalog.cs b/main/src/core/Mono.TextEditor.Platform/PlatformCatalog.cs index cb9f47594a..5405b35b8d 100644 --- a/main/src/core/Mono.TextEditor.Platform/PlatformCatalog.cs +++ b/main/src/core/Mono.TextEditor.Platform/PlatformCatalog.cs @@ -60,7 +60,7 @@ namespace Microsoft.VisualStudio.Platform AddinManager.LoadAddin(null, assemblyNode.Addin.Id);
var assemblyFilePath = assemblyNode.Addin.GetFilePath(assemblyNode.FileName);
- var assembly = MonoDevelop.Core.Platform.AssemblyLoad(assemblyFilePath);
+ var assembly = Runtime.SystemAssemblyService.LoadAssemblyFrom(assemblyFilePath);
catalog.Catalogs.Add(new AssemblyCatalog(assembly));
}
catch (Exception e)
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/IMainToolbarView.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/IMainToolbarView.cs index cacb53dc04..8a018aa5e1 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/IMainToolbarView.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/IMainToolbarView.cs @@ -241,7 +241,7 @@ namespace MonoDevelop.Components.MainToolbar /// <summary> /// Rebuilds the toolbar. /// </summary> - /// <param name="buttons">A list of ButtonBarGroups.</param> + /// <param name="groups">A list of ButtonBarGroups.</param> void RebuildToolbar (IEnumerable<ButtonBarGroup> groups); /// <summary> diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbarController.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbarController.cs index 6ec452bc13..befe45b264 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbarController.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbarController.cs @@ -531,7 +531,9 @@ namespace MonoDevelop.Components.MainToolbar static IEnumerable<ExecutionTarget> GetExecutionTargets (string configuration) { var sol = IdeApp.ProjectOperations.CurrentSelectedSolution; +#pragma warning disable CS0618 // Type or member is obsolete if (sol == null || !sol.SingleStartup || sol.StartupItem == null) +#pragma warning restore CS0618 // Type or member is obsolete return new ExecutionTarget [0]; var conf = sol.Configurations[configuration]; if (conf == null) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/XwtBoxTooltip.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/XwtBoxTooltip.cs index e60ce55e3b..68b9562917 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/XwtBoxTooltip.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/XwtBoxTooltip.cs @@ -36,7 +36,6 @@ namespace MonoDevelop.Components TaskSeverity? severity; TooltipPopoverWindow tooltipWindow; Xwt.Popover xwtPopover; - bool mouseOver, mouseOverTooltip; public string ToolTip { get { return tip; } @@ -130,14 +129,12 @@ namespace MonoDevelop.Components protected override void OnMouseEntered (EventArgs args) { base.OnMouseEntered (args); - mouseOver = true; ShowTooltip (); } protected override void OnMouseExited (EventArgs args) { base.OnMouseExited (args); - mouseOver = false; HideTooltip (); } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/CompletionData.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/CompletionData.cs index 493e6a5d5a..9cd794fdd1 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/CompletionData.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/CompletionData.cs @@ -230,7 +230,9 @@ namespace MonoDevelop.Ide.CodeCompletion public virtual bool OverloadGroupEquals (CompletionData other) { +#pragma warning disable CS0618 // Type or member is obsolete if (!IsOverload (other)) +#pragma warning restore CS0618 // Type or member is obsolete return false; return DisplayText == other.DisplayText; } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/CompletionListWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/CompletionListWindow.cs index e7bfb2b472..a49e779571 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/CompletionListWindow.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/CompletionListWindow.cs @@ -385,7 +385,7 @@ namespace MonoDevelop.Ide.CodeCompletion } IMutableCompletionDataList mutableList; - public ICompletionDataList CompletionDataList { + new public ICompletionDataList CompletionDataList { get { return completionDataList; } set { completionDataList = value; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ParameterInformationWindowManager.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ParameterInformationWindowManager.cs index 1f71cfa6f9..6d349e2ce5 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ParameterInformationWindowManager.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ParameterInformationWindowManager.cs @@ -226,7 +226,7 @@ namespace MonoDevelop.Ide.CodeCompletion static bool wasCompletionWindowVisible; static int lastW = -1, lastH = -1; - internal static async void UpdateWindow (CompletionTextEditorExtension textEditorExtension, ICompletionWidget completionWidget) + internal static void UpdateWindow (CompletionTextEditorExtension textEditorExtension, ICompletionWidget completionWidget) { // Updates the parameter information window from the information // of the current method overload diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Codons/TemplateCategoryCodon.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Codons/TemplateCategoryCodon.cs index 14ac00dea9..f3c2c9e0bb 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Codons/TemplateCategoryCodon.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Codons/TemplateCategoryCodon.cs @@ -35,7 +35,7 @@ namespace MonoDevelop.Ide.Codons [ExtensionNode (Description="A template category.")]
internal class TemplateCategoryCodon : ExtensionNode
{
- [ObsoleteAttribute ("This is ignored when generating translations.")]
+ // OBSOLETE: This member is ignored when generating translations.
[NodeAttribute ("name", "Name of the category.", Localizable=true)]
string name;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileCommands.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileCommands.cs index 63f93482cf..6e28dc5616 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileCommands.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileCommands.cs @@ -166,7 +166,7 @@ namespace MonoDevelop.Ide.Commands protected override void Run () { if (IdeApp.Workbench.ActiveDocument != null) - IdeApp.Workbench.ActiveDocument.Close (); + IdeApp.Workbench.ActiveDocument.Close ().Ignore(); } protected override void Update (CommandInfo info) @@ -181,7 +181,7 @@ namespace MonoDevelop.Ide.Commands { protected override void Run () { - IdeApp.Workspace.Close (); + IdeApp.Workspace.Close ().Ignore(); } protected override void Update (CommandInfo info) @@ -417,7 +417,7 @@ namespace MonoDevelop.Ide.Commands { protected override void Run () { - IdeApp.Exit (); + IdeApp.Exit ().Ignore(); } } // MonoDevelop.Ide.Commands.FileTabCommands.CloseAllButThis Implemented in FileTabCommands.cs diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileTabCommands.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileTabCommands.cs index ae70c81ae8..42f3674a04 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileTabCommands.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileTabCommands.cs @@ -80,7 +80,7 @@ namespace MonoDevelop.Ide.Commands if (dirtyDialogShown) doc.Window.CloseWindow (true); else - doc.Close (); + doc.Close ().Ignore(); } } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/Formats/Sublime3Format.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/Formats/Sublime3Format.cs index db4d092e1b..dcf7aca36c 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/Formats/Sublime3Format.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/Formats/Sublime3Format.cs @@ -764,10 +764,9 @@ namespace MonoDevelop.Ide.Editor.Highlighting case '>': recordGroupName = false; if (replaceGroup) { - bool foundGroup = false; - result.Append ("\\k<"); - result.Append (curGroupName.ToString ()); - result.Append (">"); + result.Append ("\\k<"); + result.Append (curGroupName.ToString ()); + result.Append (">"); replaceGroup = false; curGroupName.Length = 0; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/Formats/TextMateFormat.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/Formats/TextMateFormat.cs index 3f4cdeb927..10da29799a 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/Formats/TextMateFormat.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/Formats/TextMateFormat.cs @@ -481,7 +481,7 @@ namespace MonoDevelop.Ide.Editor.Highlighting int g; try { g = int.Parse (kv.Key); - } catch (Exception e) { + } catch (Exception) { named.Add (Tuple.Create (kv.Key, s)); continue; } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/ISyntaxHighlighting.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/ISyntaxHighlighting.cs index 74e555813b..34b6f7d4f3 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/ISyntaxHighlighting.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/ISyntaxHighlighting.cs @@ -83,7 +83,7 @@ namespace MonoDevelop.Ide.Editor.Highlighting return Task.FromResult (ScopeStack.Empty); } - public event EventHandler<LineEventArgs> HighlightingStateChanged; + public event EventHandler<LineEventArgs> HighlightingStateChanged { add { } remove { } } public void Dispose()
{
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/PObject.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/PObject.cs index 497441c3ce..865191b39d 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/PObject.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/PObject.cs @@ -688,7 +688,7 @@ namespace MonoDevelop.Ide.Editor.Highlighting } } - public static PDictionary FromStream (Stream stream) + new public static PDictionary FromStream (Stream stream) { bool isBinary; return FromStream (stream, out isBinary); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/RegexEngine/Regex.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/RegexEngine/Regex.cs index 75e0ab7f17..9acfd7bae1 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/RegexEngine/Regex.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/RegexEngine/Regex.cs @@ -961,17 +961,17 @@ namespace MonoDevelop.Ide.Editor.Highlighting.RegexEngine { return new Regex(pattern, options, matchTimeout, true).Replace(input, replacement); } - /* + /* * Does the replacement */ - /// <devdoc> - /// <para> - /// Replaces all occurrences of - /// the <paramref name="pattern "/> with the <paramref name="replacement"/> pattern, starting at the - /// first character in the input string, using the previous patten. - /// </para> - /// </devdoc> - public String Replace(string input, String replacement) { + /// <devdoc> + /// <para> + /// Replaces all occurrences of + /// the <paramref name="input "/> with the <paramref name="replacement"/> pattern, starting at the + /// first character in the input string, using the previous patten. + /// </para> + /// </devdoc> + public String Replace(string input, String replacement) { if (input == null) throw new ArgumentNullException("input"); @@ -979,16 +979,16 @@ namespace MonoDevelop.Ide.Editor.Highlighting.RegexEngine { return Replace(input, replacement, -1, UseOptionR() ? input.Length : 0); } - /* + /* * Does the replacement */ - /// <devdoc> - /// <para> - /// Replaces all occurrences of the (previously defined) <paramref name="pattern "/>with the - /// <paramref name="replacement"/> pattern, starting at the first character in the input string. - /// </para> - /// </devdoc> - public String Replace(string input, String replacement, int count) { + /// <devdoc> + /// <para> + /// Replaces all occurrences of the (previously defined) <paramref name="input "/>with the + /// <paramref name="replacement"/> pattern, starting at the first character in the input string. + /// </para> + /// </devdoc> + public String Replace(string input, String replacement, int count) { if (input == null) throw new ArgumentNullException("input"); @@ -996,17 +996,17 @@ namespace MonoDevelop.Ide.Editor.Highlighting.RegexEngine { return Replace(input, replacement, count, UseOptionR() ? input.Length : 0); } - /* + /* * Does the replacement */ - /// <devdoc> - /// <para> - /// Replaces all occurrences of the <paramref name="pattern "/>with the recent - /// <paramref name="replacement"/> pattern, starting at the character position - /// <paramref name="startat."/> - /// </para> - /// </devdoc> - public String Replace(string input, String replacement, int count, int startat) { + /// <devdoc> + /// <para> + /// Replaces all occurrences of the <paramref name="input "/>with the recent + /// <paramref name="replacement"/> pattern, starting at the character position + /// <paramref name="startat"/> + /// </para> + /// </devdoc> + public String Replace(string input, String replacement, int count, int startat) { if (input == null) throw new ArgumentNullException("input"); @@ -1028,13 +1028,6 @@ namespace MonoDevelop.Ide.Editor.Highlighting.RegexEngine { /* * Static version of simple Replace call */ - /// <devdoc> - /// <para> - /// Replaces all occurrences of the <paramref name="pattern "/>with the - /// <paramref name="replacement"/> pattern - /// <paramref name="."/> - /// </para> - /// </devdoc> public static String Replace(string input, String pattern, MatchEvaluator evaluator) { return Replace(input, pattern, evaluator, RegexOptions.None, DefaultMatchTimeout); } @@ -1042,12 +1035,6 @@ namespace MonoDevelop.Ide.Editor.Highlighting.RegexEngine { /* * Static version of simple Replace call */ - /// <devdoc> - /// <para> - /// Replaces all occurrences of the <paramref name="pattern "/>with the recent - /// <paramref name="replacement"/> pattern, starting at the first character<paramref name="."/> - /// </para> - /// </devdoc> public static String Replace(string input, String pattern, MatchEvaluator evaluator, RegexOptions options) { return Replace(input, pattern, evaluator, options, DefaultMatchTimeout); } @@ -1064,13 +1051,6 @@ namespace MonoDevelop.Ide.Editor.Highlighting.RegexEngine { /* * Does the replacement */ - /// <devdoc> - /// <para> - /// Replaces all occurrences of the <paramref name="pattern "/>with the recent - /// <paramref name="replacement"/> pattern, starting at the first character - /// position<paramref name="."/> - /// </para> - /// </devdoc> public String Replace(string input, MatchEvaluator evaluator) { if (input == null) @@ -1082,13 +1062,6 @@ namespace MonoDevelop.Ide.Editor.Highlighting.RegexEngine { /* * Does the replacement */ - /// <devdoc> - /// <para> - /// Replaces all occurrences of the <paramref name="pattern "/>with the recent - /// <paramref name="replacement"/> pattern, starting at the first character - /// position<paramref name="."/> - /// </para> - /// </devdoc> public String Replace(string input, MatchEvaluator evaluator, int count) { if (input == null) @@ -1100,13 +1073,6 @@ namespace MonoDevelop.Ide.Editor.Highlighting.RegexEngine { /* * Does the replacement */ - /// <devdoc> - /// <para> - /// Replaces all occurrences of the (previouly defined) <paramref name="pattern "/>with - /// the recent <paramref name="replacement"/> pattern, starting at the character - /// position<paramref name=" startat."/> - /// </para> - /// </devdoc> public String Replace(string input, MatchEvaluator evaluator, int count, int startat) { if (input == null) @@ -1152,13 +1118,6 @@ namespace MonoDevelop.Ide.Editor.Highlighting.RegexEngine { /* * Does a split */ - /// <devdoc> - /// <para> - /// Splits the <paramref name="input "/>string at the position defined by - /// a previous <paramref name="pattern"/> - /// . - /// </para> - /// </devdoc> public string[] Split(string input) { if (input == null) @@ -1170,12 +1129,6 @@ namespace MonoDevelop.Ide.Editor.Highlighting.RegexEngine { /* * Does a split */ - /// <devdoc> - /// <para> - /// Splits the <paramref name="input "/>string at the position defined by a previous - /// <paramref name="pattern"/> . - /// </para> - /// </devdoc> public string[] Split(string input, int count) { if (input == null) @@ -1187,12 +1140,6 @@ namespace MonoDevelop.Ide.Editor.Highlighting.RegexEngine { /* * Does a split */ - /// <devdoc> - /// <para> - /// Splits the <paramref name="input "/>string at the position defined by a previous - /// <paramref name="pattern"/> . - /// </para> - /// </devdoc> public string[] Split(string input, int count, int startat) { if (input==null) throw new ArgumentNullException("input"); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/RegexEngine/RegexMatchCollection.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/RegexEngine/RegexMatchCollection.cs index bd7d9fbb24..4f96d64e0b 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/RegexEngine/RegexMatchCollection.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/RegexEngine/RegexMatchCollection.cs @@ -183,7 +183,7 @@ namespace MonoDevelop.Ide.Editor.Highlighting.RegexEngine { _matches.CopyTo(array, arrayIndex); #endif } - catch (ArrayTypeMismatchException ex) + catch (ArrayTypeMismatchException) { #if FEATURE_LEGACYNETCF if (CompatibilitySwitches.IsAppEarlierThanWindowsPhone8) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/RegexEngine/RegexMatchTimeoutException.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/RegexEngine/RegexMatchTimeoutException.cs index 1bc18d44aa..ae3174b944 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/RegexEngine/RegexMatchTimeoutException.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/RegexEngine/RegexMatchTimeoutException.cs @@ -1,10 +1,10 @@ -///------------------------------------------------------------------------------ -/// <copyright file="RegexMatchTimeoutException.cs" company="Microsoft"> -/// Copyright (c) Microsoft Corporation. All rights reserved. -/// </copyright> -/// -/// <owner>gpaperin</owner> -///------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ +// <copyright file="RegexMatchTimeoutException.cs" company="Microsoft"> +// Copyright (c) Microsoft Corporation. All rights reserved. +// </copyright> +// +// <owner>gpaperin</owner> +//------------------------------------------------------------------------------ using System; using System.Runtime.Serialization; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.TextMate/TextMateLanguage.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.TextMate/TextMateLanguage.cs index 7736a807e6..a91d784c9c 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.TextMate/TextMateLanguage.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.TextMate/TextMateLanguage.cs @@ -114,7 +114,7 @@ namespace MonoDevelop.Ide.Editor.TextMate try { highlightPairs.Add (Tuple.Create (((PString)pair [0]).Value, ((PString)pair [1]).Value)); } catch (Exception e) { - LoggingService.LogError ("Error while loading highlight pairs from :" + setting); + LoggingService.LogError ("Error while loading highlight pairs from :" + setting, e); } } } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.ExternalTools/ExternalToolPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.ExternalTools/ExternalToolPanel.cs index 13beb72f70..a5832b4c94 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.ExternalTools/ExternalToolPanel.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.ExternalTools/ExternalToolPanel.cs @@ -76,7 +76,6 @@ namespace MonoDevelop.Ide.ExternalTools bool lockStoreValues = false; EventBoxTooltip keyBindingInfoTooltip; - string defaultKeyBindingTooltipText; public ExternalToolPanelWidget () { diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/IDEStyleOptionsPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/IDEStyleOptionsPanel.cs index 2f735bd848..66fb6d3b31 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/IDEStyleOptionsPanel.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/IDEStyleOptionsPanel.cs @@ -136,7 +136,7 @@ namespace MonoDevelop.Ide.Gui.OptionPanels void RestartClicked (object sender, System.EventArgs e) { Store (); - IdeApp.Restart (true); + IdeApp.Restart (true).Ignore(); } void UpdateRestartMessage () diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/SdkLocationPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/SdkLocationPanel.cs index 8621a4ee03..88e7817781 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/SdkLocationPanel.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/SdkLocationPanel.cs @@ -133,7 +133,7 @@ namespace MonoDevelop.Ide.Gui.OptionPanels var tableRestart = new RestartPanel (); tableRestart.RestartRequested += (sender, e) => { ApplyChanges (); - IdeApp.Restart (true); + IdeApp.Restart (true).Ignore(); }; PackStart (tableRestart, false, false, 0); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/FolderNodeBuilder.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/FolderNodeBuilder.cs index a8beb2601e..0882519437 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/FolderNodeBuilder.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/FolderNodeBuilder.cs @@ -366,7 +366,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad if (res == AlertButton.Save) { try { foreach (Document doc in filesToSave) { - doc.Save (); + await doc.Save (); } } catch (Exception ex) { MessageService.ShowError (GettextCatalog.GetString ("Save operation failed."), ex); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/SolutionNodeBuilder.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/SolutionNodeBuilder.cs index 16567bd651..564939e71f 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/SolutionNodeBuilder.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/SolutionNodeBuilder.cs @@ -371,7 +371,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad { foreach (ITreeNavigator node in CurrentNodes) { Solution solution = (Solution) node.DataItem; - IdeApp.Workspace.CloseWorkspaceItem (solution); + IdeApp.Workspace.CloseWorkspaceItem (solution).Ignore(); } } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/WorkspaceNodeBuilder.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/WorkspaceNodeBuilder.cs index dcd1c2b6cb..44afa06e22 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/WorkspaceNodeBuilder.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/WorkspaceNodeBuilder.cs @@ -284,7 +284,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad { foreach (ITreeNavigator node in CurrentNodes) { Workspace ws = (Workspace) node.DataItem; - IdeApp.Workspace.CloseWorkspaceItem (ws); + IdeApp.Workspace.CloseWorkspaceItem (ws).Ignore(); } } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Wizard/WizardDialogController.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Wizard/WizardDialogController.cs index 0579001cc5..94ee7d76f6 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Wizard/WizardDialogController.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Wizard/WizardDialogController.cs @@ -185,13 +185,13 @@ namespace MonoDevelop.Ide.Gui.Wizard throw new ArgumentException ("pages must contain at least one page.", nameof (pages)); } - protected override async Task<IWizardDialogPage> OnGoNext (CancellationToken token) + protected override Task<IWizardDialogPage> OnGoNext (CancellationToken token) { var currentIndex = pages.IndexOf (CurrentPage); if (currentIndex == pages.Count - 1) - throw new InvalidOperationException (); + return Task.FromException<IWizardDialogPage>(new InvalidOperationException ()); else - return pages [currentIndex + 1]; + return Task.FromResult (pages [currentIndex + 1]); } protected override Task<IWizardDialogPage> OnGoBack (CancellationToken token) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DefaultWorkbench.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DefaultWorkbench.cs index fc475c1708..26408ed26f 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DefaultWorkbench.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DefaultWorkbench.cs @@ -92,8 +92,6 @@ namespace MonoDevelop.Ide.Gui MainToolbarController toolbar; MonoDevelopStatusBar bottomBar; - Timer saveTimer; - #if DUMMY_STRINGS_FOR_TRANSLATION_DO_NOT_COMPILE private void DoNotCompile () { @@ -672,7 +670,7 @@ namespace MonoDevelop.Ide.Gui content.UntitledName = content.ContentName; content.ContentName = null; } else { - ((SdiWorkspaceWindow)content.WorkbenchWindow).CloseWindow (true, true); + ((SdiWorkspaceWindow)content.WorkbenchWindow).CloseWindow (true, true).Ignore(); } } } @@ -684,7 +682,7 @@ namespace MonoDevelop.Ide.Gui content.UntitledName = content.ContentName; content.ContentName = null; } else { - ((SdiWorkspaceWindow)content.WorkbenchWindow).CloseWindow (true, true); + ((SdiWorkspaceWindow)content.WorkbenchWindow).CloseWindow (true, true).Ignore(); } return; } @@ -1280,7 +1278,7 @@ namespace MonoDevelop.Ide.Gui internal void CloseClicked (object o, TabEventArgs e) { - ((SdiWorkspaceWindow)e.Tab.Content).CloseWindow (false, true); + ((SdiWorkspaceWindow)e.Tab.Content).CloseWindow (false, true).Ignore(); } internal void RemoveTab (DockNotebook tabControl, int pageNum, bool animate) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs index a1c6bb1584..1e7a7202dc 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs @@ -405,10 +405,10 @@ namespace MonoDevelop.Ide.Gui foreach (Document doc in docs) { if (doc != ActiveDocument) - doc.Close (); + doc.Close ().Ignore(); } if (!leaveActiveDocumentOpen && ActiveDocument != null) - ActiveDocument.Close (); + ActiveDocument.Close ().Ignore(); } internal Pad ShowPad (PadCodon content) @@ -863,14 +863,14 @@ namespace MonoDevelop.Ide.Gui args.Cancel = true; await FindDocument (window).Save (); viewContent.IsDirty = false; - window.CloseWindow (true); + await window.CloseWindow (true); return; } else if (result == AlertButton.SaveAs) { args.Cancel = true; var resultSaveAs = await FindDocument (window).SaveAs (); if (resultSaveAs) { viewContent.IsDirty = false; - window.CloseWindow (true); + await window.CloseWindow (true); } else { window.SelectWindow (); } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkNewProjectDialogBackend.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkNewProjectDialogBackend.cs index 1ae6019ac8..6b09a39bdf 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkNewProjectDialogBackend.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkNewProjectDialogBackend.cs @@ -119,7 +119,7 @@ namespace MonoDevelop.Ide.Projects LoadTemplates ();
SelectTemplateDefinedbyController ();
if (CanMoveToNextPage && !controller.ShowTemplateSelection)
- MoveToNextPage ();
+ MoveToNextPage ().Ignore();
}
void SetTemplateCategoryCellData (TreeViewColumn col, CellRenderer renderer, TreeModel model, TreeIter it)
@@ -635,7 +635,7 @@ namespace MonoDevelop.Ide.Projects {
if (CanMoveToNextPage && !isLastPressedKeySpace &&
IsSolutionTemplateOnActivatedRow ((Gtk.TreeView)o, args)) - MoveToNextPage ();
+ MoveToNextPage ().Ignore();
isLastPressedKeySpace = false;
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/ClrVersionFileTemplateCondition.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/ClrVersionFileTemplateCondition.cs index d799c63aa2..089e336562 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/ClrVersionFileTemplateCondition.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/ClrVersionFileTemplateCondition.cs @@ -65,7 +65,9 @@ namespace MonoDevelop.Ide.Templates DotNetProject dnp = proj as DotNetProject; if (dnp != null) { +#pragma warning disable CS0618 // Type or member is obsolete ClrVersion pver = dnp.TargetFramework.ClrVersion; +#pragma warning restore CS0618 // Type or member is obsolete switch (condition) { case ClrVersionCondition.Equal: return (pver == clrVersion); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopWorkspace.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopWorkspace.cs index 36db51a996..74be1344ef 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopWorkspace.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopWorkspace.cs @@ -1338,7 +1338,7 @@ namespace MonoDevelop.Ide.TypeSystem List<MonoDevelop.Projects.DotNetProject> modifiedProjects = new List<MonoDevelop.Projects.DotNetProject> ();
object projectModifyLock = new object ();
bool freezeProjectModify;
- async void OnProjectModified (object sender, MonoDevelop.Projects.SolutionItemModifiedEventArgs args)
+ void OnProjectModified (object sender, MonoDevelop.Projects.SolutionItemModifiedEventArgs args)
{
lock (projectModifyLock) {
if (freezeProjectModify)
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TextPolicyDocumentOptionsProvider.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TextPolicyDocumentOptionsProvider.cs index c84afb92bd..b226c3ecec 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TextPolicyDocumentOptionsProvider.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TextPolicyDocumentOptionsProvider.cs @@ -47,16 +47,16 @@ namespace MonoDevelop.Ide.TypeSystem class TextPolicyDocumentOptionsProvider : IDocumentOptionsProvider { - public async Task<IDocumentOptions> GetOptionsForDocumentAsync (Document document, CancellationToken cancellationToken) + public Task<IDocumentOptions> GetOptionsForDocumentAsync (Document document, CancellationToken cancellationToken) { var mimeChain = DesktopService.GetMimeTypeInheritanceChainForRoslynLanguage (document.Project.Language); if (mimeChain == null) { - return null; + return Task.FromResult<IDocumentOptions>(null); } var project = TypeSystemService.GetMonoProject (document.Project); var policy = project.Policies.Get<TextStylePolicy> (mimeChain); - return new TextDocumentOptions (policy); + return Task.FromResult<IDocumentOptions>(new TextDocumentOptions (policy)); } class TextDocumentOptions : IDocumentOptions diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs index a435b02aa0..1b1049e893 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs @@ -116,7 +116,7 @@ namespace MonoDevelop.Ide // XWT initialization FilePath p = typeof(IdeStartup).Assembly.Location; - Platform.AssemblyLoad(p.ParentDirectory.Combine("Xwt.Gtk.dll")); + Runtime.SystemAssemblyService.LoadAssemblyFrom(p.ParentDirectory.Combine("Xwt.Gtk.dll")); Xwt.Application.InitializeAsGuest (Xwt.ToolkitType.Gtk); Xwt.Toolkit.CurrentEngine.RegisterBackend<IExtendedTitleBarWindowBackend,GtkExtendedTitleBarWindowBackend> (); Xwt.Toolkit.CurrentEngine.RegisterBackend<IExtendedTitleBarDialogBackend,GtkExtendedTitleBarDialogBackend> (); @@ -627,7 +627,7 @@ namespace MonoDevelop.Ide foreach (var path in paths) { var file = BrandingService.GetFile (path.Replace ('/',Path.DirectorySeparatorChar)); if (File.Exists (file)) {
- Assembly asm = Platform.AssemblyLoad(file); + Assembly asm = Runtime.SystemAssemblyService.LoadAssemblyFrom(file); var t = asm.GetType (type, true); var c = Activator.CreateInstance (t) as IdeCustomizer; if (c == null) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/ProjectOperations.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/ProjectOperations.cs index a88c448dfc..b17f9bf012 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/ProjectOperations.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/ProjectOperations.cs @@ -939,7 +939,7 @@ namespace MonoDevelop.Ide SolutionItem prj = item as SolutionItem; if (prj == null) { if (MessageService.Confirm (question, AlertButton.Remove) && IdeApp.Workspace.RequestItemUnload (item)) - RemoveItemFromSolution (prj); + RemoveItemFromSolution (prj).Ignore(); return; } @@ -954,7 +954,7 @@ namespace MonoDevelop.Ide if (MessageService.RunCustomDialog (dlg) == (int) Gtk.ResponseType.Ok) { // Remove the project before removing the files to avoid unnecessary events - RemoveItemFromSolution (prj); + RemoveItemFromSolution (prj).Ignore(); List<FilePath> files = dlg.GetFilesToDelete (); using (ProgressMonitor monitor = new MessageDialogProgressMonitor (true)) { @@ -979,18 +979,18 @@ namespace MonoDevelop.Ide } } else if (result == AlertButton.Remove && IdeApp.Workspace.RequestItemUnload (prj)) { - RemoveItemFromSolution (prj); + RemoveItemFromSolution (prj).Ignore(); } } - void RemoveItemFromSolution (SolutionFolderItem prj) + async Task RemoveItemFromSolution (SolutionFolderItem prj) { foreach (var doc in IdeApp.Workbench.Documents.Where (d => d.Project == prj).ToArray ()) - doc.Close (); + await doc.Close (); Solution sol = prj.ParentSolution; prj.ParentFolder.Items.Remove (prj); prj.Dispose (); - IdeApp.ProjectOperations.SaveAsync (sol); + await IdeApp.ProjectOperations.SaveAsync (sol); } /// <summary> diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/RootWorkspace.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/RootWorkspace.cs index a5477722b1..05651bbb3e 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/RootWorkspace.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/RootWorkspace.cs @@ -930,11 +930,10 @@ namespace MonoDevelop.Ide internal void NotifyItemAdded (WorkspaceItem item) { - try { - MonoDevelop.Ide.TypeSystem.TypeSystemService.Load (item, null); - } catch (Exception ex) { - LoggingService.LogError ("Could not load parser database.", ex); - } + MonoDevelop.Ide.TypeSystem.TypeSystemService.Load (item, null).ContinueWith(t => { + if (t.IsFaulted) + LoggingService.LogError("Could not load parser database.", t.Exception); + }); if (Runtime.IsMainThread) NotifyItemAddedGui (item, IsReloading); else { |