0

I'm writing an extension for vs4mac and want to add an entry to the editor's contextmenu. Can anybody tell me what the extension point is?

I tried the following in the Manifest.addin.xml:

    <Extension path="/MonoDevelop/Ide/Commands">
        <Command id="EssentialsAddin.AddinCommands.TEST"
                _label="TEST" 
                defaultHandler="EssentialsAddin.CommandHandlers.TestHandler" />
    </Extension>

    <Extension path="/MonoDevelop/SourceEditor2/ContextMenu/Editor">
        <Condition id="FileType" fileExtensions=".cs">
            <CommandItem id="EssentialsAddin.AddinCommands.TEST"/>
        </Condition>
    </Extension>

    <Extension path = "/MonoDevelop/TextEditor/ContextMenu/Editor">
        <Condition id="FileType" fileExtensions=".cs">
            <CommandItem id="EssentialsAddin.AddinCommands.TEST" />
        </Condition>
    </Extension>

but no luck.

  • VS for Mac is not open sourced nor related to MonoDevelop. You will have to use a decompiler to analyze its current implementation and learn how to extend now. https://blog.lextudio.com/the-end-of-monodevelop-80b383dab34b The editor in VS for Mac is more a Mac version of the one in VS for Windows, so its extension model should be different. – Lex Li Feb 17 '22 at 15:23
  • "/MonoDevelop/TextEditor/ContextMenu/Editor" looks like the correct path for the new editor. Which VS Mac are you targeting? – Matt Ward Feb 24 '22 at 23:06
  • 1
    I'm targeting 8.10.19 (build 2) – Ivo Krugers Mar 02 '22 at 08:29
  • @MattWard can you point me to an example? – Ivo Krugers Mar 02 '22 at 08:34
  • Created this sample addin which should be standalone and work with VS Mac 8.10 - https://github.com/mrward/vsmac-text-editor-context-menu-addin – Matt Ward Mar 02 '22 at 22:51
  • That does the trick! I was not missing anything in the manifest. The problem was a missing Dependency `[assembly: AddinDependency("::MonoDevelop.TextEditor", MonoDevelop.BuildInfo.Version)]` – Ivo Krugers Mar 07 '22 at 08:46

0 Answers0