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

EDIT comment not working #7

Open
scottdorman opened this issue May 24, 2024 · 2 comments · Fixed by #8
Open

EDIT comment not working #7

scottdorman opened this issue May 24, 2024 · 2 comments · Fixed by #8
Assignees
Labels
enhancement New feature or request released

Comments

@scottdorman
Copy link

This may be due to newer versions of Visual Studio, but it appears that the "EDIT" comment support isn't working anymore. In Visual Studio 2022 (running community edition, and haven't tested this in any other versions or editions), comments are stored in the regex XML as all lowercase, so the Contains("EDIT") calls always return false.

This affects the following call sites:

var editing = data[index].Element("comment")?.Value.Contains("EDIT") == true;

.Where(e => e.Value.Contains("EDIT"));

and may also affect the REGEX at

return Regex.Replace(comment, @"\s*EDIT\s*", string.Empty);

If you retarget this to .NET 5.0+, you can use an overload on Contains that takes a StringComparison parameter.

@scottdorman
Copy link
Author

I can manually edit the XML to change the comment to uppercase, which works around the issue but is counterproductive.

@stevencohn
Copy link
Owner

Sorry I just saw this. I keep VS updated and haven't seen this but I'll take a look. Thanks

@stevencohn stevencohn self-assigned this Aug 18, 2024
@stevencohn stevencohn linked a pull request Aug 18, 2024 that will close this issue
@stevencohn stevencohn added enhancement New feature or request released labels Aug 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants