XamlStyler icon indicating copy to clipboard operation
XamlStyler copied to clipboard

Remove inclusion of context menu in all documents

Open mrlacey opened this issue 1 year ago • 1 comments

Description:

Fixes #132 (issue)

This removes unneeded and incorrect VSCT entries for the "Format XAML" context menu option.

  • Removes from "IDM_VS_CTXT_EZDOCWINTAB" as this is the group in the ActiveDocument.
  • Removes from "DVisualStudioXamarinWindowContextMenu" (Symbol 0x040D of the "VS Main Menu") - I can't find a definition
  • This leaves the entry to add the group in the XAML Window context menu -- which is what is wanted and all that is needed.

I assume the "Xamarin" entry was added for a special case (in an earlier version of VS) that no longer applies.

Checklist:

  • [x] I have commented my code, particularly in hard-to-understand areas
  • [x] My changes generate no new warnings
  • [ ] I have added tests that prove my fix is effective or that my feature works
  • [x] New and existing unit tests pass locally with my changes
  • [ ] I have tested my changes by running the extension in VS2017
  • [x] I have tested my changes by running the extension in VS2019
  • [x] I have tested my changes by running the extension in VS2022
  • [ ] If changes to the documentation are needed, I have noted this in the description above

mrlacey avatar Jan 10 '24 09:01 mrlacey

Here's an update on my current investigation into resolving the issues blocking this.

Everything here comes with a big AFAIK disclaimer.

There is an existing context menu for when editing XAML documents. Adding to this is easy and was part of the original PR.

The context menu for the document tab is separate and is the same for all document types. I can add to this and filter it so it only shows based on the "Content Type" of the active document. I can do this for XAML files.

*.axaml files are different.

AXAML documents use the standard code editor, but there is no specific context menu to add to that only shows for AXAML documents. I can add the "Format XAML" option to this menu but haven't been able to get it to only show based on the file extension.

AXAML documents have a content type of "xml". I can't get filtering on this content type to work correctly. 😞

I will keep investigating and trying to get this all working as desired....

mrlacey avatar Apr 10 '24 19:04 mrlacey