Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove inclusion of context menu in all documents #460

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

mrlacey
Copy link
Contributor

@mrlacey mrlacey commented Jan 10, 2024

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:

  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have tested my changes by running the extension in VS2017
  • I have tested my changes by running the extension in VS2019
  • 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

@@ -235,9 +222,6 @@
<IDSymbol name="GroupIDXamlStylerContextCrossProjectMultiSolutionFolderGroup" value="0x105a" />
<IDSymbol name="GroupIDXamlStylerContextCrossProjectMultiProjectFolderGroup" value="0x105b" />

<!-- This is the command set for the document tab context menu -->
<IDSymbol name="GroupIDXamlStylerContextDocumentTabGroup" value="0x1070" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR removes format option from file tab context menu:

image

I suspect it might be this one but did not test myself.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, missed this comment previously.
The current (prior to this PR) version adds the "Format XAML" option to the context menu on the tab of any document window. Am I right to assume this should be filtered to just xaml files also?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is ideally filtered to xaml (and axaml) files.

@@ -35,12 +35,6 @@
<Group guid="GuidXamlStylerMenuSet" id="GroupIDXamlStylerMenu" priority="0x0001">
<Parent guid="GuidVisualStudioXAMLWindowContextMenu" id="IDVisualStudioXAMLWindowContextMenu"/>
</Group>
<Group guid="GuidXamlStylerMenuSet" id="GroupIDXamlStylerMenu" priority="0x0001">
<Parent guid="GuidVisualStudioXamarWindowContextMenu" id="IDVisualStudioXamarinWindowContextMenu"/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@NicoVermeir do you recall why we added these Xamarin-specific entries? Are they still relevant?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like they were there for AXAML support :/

@mrlacey
Copy link
Contributor Author

mrlacey commented Apr 10, 2024

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....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hide the "Format XAML" option outside of the XAML editor
2 participants