diff options
author | Aaron Bockover <abock@microsoft.com> | 2019-03-07 00:52:04 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-07 00:52:04 +0300 |
commit | 902fb2082ce495d14a09fdf829fc86d58fa877fd (patch) | |
tree | 961acfd54f1d893101beba3fb6f19d94f4e4bdd4 /main | |
parent | debfa3d9a52108e87dcf74e4ee6cf73ac010a97d (diff) | |
parent | 6625c52d5a91cb38ff83c35d1d7fba97c0f7ad21 (diff) |
Merge pull request #294 from xamarin/pr-anvod-gotoimplementation
Fixes VSTS Bug 769245: Non-editor commands are missing from the editor context menu
Diffstat (limited to 'main')
8 files changed, 91 insertions, 1 deletions
diff --git a/main/src/addins/CSharpBinding/CSharpBinding.addin.xml b/main/src/addins/CSharpBinding/CSharpBinding.addin.xml index 93f01bbc85..940db43069 100644 --- a/main/src/addins/CSharpBinding/CSharpBinding.addin.xml +++ b/main/src/addins/CSharpBinding/CSharpBinding.addin.xml @@ -336,5 +336,8 @@ <Extension path = "/MonoDevelop/Ide/GlobalOptionsDialog/TextEditor/Analysis/C#"> <Panel id="CodeStylePanel" _label="Code Style" fill="true" class="MonoDevelop.CSharp.OptionProvider.CodeStylePage" grouping="Tab" icon="md-prefs-code-rules" insertbefore="CodeActions" /> </Extension> - + + <Extension path = "/MonoDevelop/TextEditor/CommandMapping"> + <Map id="MonoDevelop.CSharp.Refactoring.Commands.SortAndRemoveImports" argsType="@MonoDevelop.CSharp.Refactoring.CommandArgsFactories.CreateSortAndRemoveUnnecessaryImportsCommandArgs" /> + </Extension> </ExtensionModel> diff --git a/main/src/addins/CSharpBinding/CSharpBinding.csproj b/main/src/addins/CSharpBinding/CSharpBinding.csproj index c2e674b0f2..94ef68c84d 100644 --- a/main/src/addins/CSharpBinding/CSharpBinding.csproj +++ b/main/src/addins/CSharpBinding/CSharpBinding.csproj @@ -289,6 +289,7 @@ <Compile Include="MonoDevelop.CSharp\CSharpPathedDocumentExtension.cs" /> <Compile Include="MonoDevelop.Ide.Completion.Presentation\RoslynExperimentationService.cs" /> <Compile Include="MonoDevelop.CSharp.Debugger\RoslynDebugInfoProvider.cs" /> + <Compile Include="MonoDevelop.CSharp.Refactoring\CommandArgsFactories.cs" /> </ItemGroup> <ItemGroup> <None Include="MonoDevelop.CSharp.CodeRefactorings\ConvertToEnum\ConvertToEnumCodeRefactoringProvider.cs" /> diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/CommandArgsFactories.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/CommandArgsFactories.cs new file mode 100644 index 0000000000..e22c7c2ce0 --- /dev/null +++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/CommandArgsFactories.cs @@ -0,0 +1,37 @@ +// +// CommandArgsFactories.cs +// +// +// Copyright (c) 2019 Microsoft +// +// 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 Microsoft.VisualStudio.Text; +using Microsoft.VisualStudio.Text.Editor; +using Microsoft.CodeAnalysis.Editor.Commanding.Commands; + +namespace MonoDevelop.CSharp.Refactoring +{ + static class CommandArgsFactories + { + public static SortAndRemoveUnnecessaryImportsCommandArgs CreateSortAndRemoveUnnecessaryImportsCommandArgs (ITextView v, ITextBuffer b) + => new SortAndRemoveUnnecessaryImportsCommandArgs (v, b); + } +}
\ No newline at end of file diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.addin.xml b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.addin.xml index fb751a2cd3..36fb18d7e9 100644 --- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.addin.xml +++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.addin.xml @@ -56,6 +56,12 @@ _label = "_Go to Declaration" shortcut = "F12" macShortcut = "Meta|D F12"/> + + <Command id = "MonoDevelop.Refactoring.RefactoryCommands.GotoImplementation" + _label = "Go to Implementation" + shortcut="Ctrl|F12" + macShortcut="Meta+Shift+I"/> + <Command id = "MonoDevelop.Refactoring.RefactoryCommands.FindReferences" _label = "_Find References" shortcut = "Shift|F12" @@ -179,5 +185,6 @@ <Map id="MonoDevelop.Refactoring.RefactoryCommands.GotoDeclaration" argsType="Microsoft.VisualStudio.Text.Editor.Commanding.Commands.GoToDefinitionCommandArgs" /> <Map id="MonoDevelop.Refactoring.RefactoryCommands.FindReferences" argsType="Microsoft.VisualStudio.Text.Editor.Commanding.Commands.FindReferencesCommandArgs" /> <Map id="MonoDevelop.Refactoring.RefactoryCommands.FindAllReferences" argsType="Microsoft.VisualStudio.Text.Editor.Commanding.Commands.FindReferencesCommandArgs" /> + <Map id="MonoDevelop.Refactoring.RefactoryCommands.GotoImplementation" argsType="@MonoDevelop.Refactoring.CommandArgsFactories.CreateGoToImplementationCommandArgs" /> </Extension> </ExtensionModel> diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.csproj b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.csproj index 9719e47d81..9dbaaeb982 100644 --- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.csproj +++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.csproj @@ -105,6 +105,7 @@ <Compile Include="MonoDevelop.AnalysisCore\Gui\ResultTooltipProvider.FloatingQuickFixIconWidget.cs" /> <Compile Include="MonoDevelop.AnalysisCore\Gui\ResultTooltipProvider.RectangleMarker.cs" /> <Compile Include="MonoDevelop.Refactoring\StreamingFindUsagesPresenter.cs" /> + <Compile Include="MonoDevelop.Refactoring\CommandArgsFactories.cs" /> </ItemGroup> <ItemGroup> <EmbeddedResource Include="MonoDevelop.Refactoring.addin.xml" /> diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/CommandArgsFactories.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/CommandArgsFactories.cs new file mode 100644 index 0000000000..d9b3915571 --- /dev/null +++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/CommandArgsFactories.cs @@ -0,0 +1,36 @@ +// +// CommandArgsFactories.cs +// +// +// Copyright (c) 2019 Microsoft +// +// 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 Microsoft.VisualStudio.Text; +using Microsoft.VisualStudio.Text.Editor; +using Microsoft.CodeAnalysis.Editor.Commanding.Commands; + +namespace MonoDevelop.Refactoring +{ + static class CommandArgsFactories + { + public static GoToImplementationCommandArgs CreateGoToImplementationCommandArgs (ITextView v, ITextBuffer b) + => new GoToImplementationCommandArgs (v, b); + } +} diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/Commands.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/Commands.cs index a07a27ec68..a8f7586837 100644 --- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/Commands.cs +++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/Commands.cs @@ -32,6 +32,8 @@ namespace MonoDevelop.Refactoring { CurrentRefactoryOperations, GotoDeclaration, // in 'referenced' in IdeViMode.cs as string + GotoImplementation, + SortAndRemoveUnnecessaryImports, FindReferences, FindAllReferences, FindDerivedClasses, 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 191947a000..a3a0e4f747 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 @@ -176,7 +176,10 @@ <Extension path = "/MonoDevelop/TextEditor/ContextMenu/Editor"> <CommandItem id = "MonoDevelop.Refactoring.RefactoryCommands.QuickFix" /> <CommandItem id = "MonoDevelop.Ide.Commands.EditCommands.Rename" /> + <CommandItem id = "MonoDevelop.CSharp.Refactoring.Commands.SortAndRemoveImports" /> + <SeparatorItem id = "Separator0" /> <CommandItem id = "MonoDevelop.Refactoring.RefactoryCommands.GotoDeclaration" /> + <CommandItem id = "MonoDevelop.Refactoring.RefactoryCommands.GotoImplementation" /> <CommandItem id = "MonoDevelop.Refactoring.RefactoryCommands.FindReferences" /> <SeparatorItem id = "Separator1" /> <CommandItem id = "MonoDevelop.Ide.Commands.EditCommands.Cut" /> |