Closed carlos-quintero closed 2 years ago
Carlos! It is a pleasant surprise to see you here. I want you to know that all of your examples and documentation on your site were a huge help for getting CodeMaid started. Back in the VS2005 days there was very little official support and information was hard to come by so I relied heavily on information that you put out there. I can't thank you enough for all that you've done for the community and I.
Thanks for the callout. This file underwent a lot of changes with the VS2022 changes and I appreciate the catch.
Hi Steve
Incidentally I removed the MZ-Tools articles from the website last week, they were outdated and, belonging to the VS add-ins era, very DTE-biased :-) but I am glad that they very useful for so many years.
Well, now Microsoft references your pull request https://github.com/codecadwallader/codemaid/pull/847/commits/12e226a2ad6e9a4ccec4c3fda1a19db63eef6efd in their documentation (https://docs.microsoft.com/en-us/visualstudio/extensibility/migration/breaking-api-list?view=vs-2022#legacy-find-api-deprecation) to show how to replace EnvDTE.Find/Replace legacy APIs. Your code has helped me a lot! Thank you very much.
Wow, thanks for pointing that documentation out. It was actually a Microsoft employee @olegtk whom did the bulk of those API deprecation updates which was super helpful for us to become compatible with VS2022. Thanks again for your off-by-1 fix and hope you're doing well.
In the CodeMaidShared/Helpers/TextDocumentHelper.cs file (https://github.com/codecadwallader/codemaid/blob/dev/CodeMaidShared/Helpers/TextDocumentHelper.cs), the method GetSnapshotPositionForTextPoint has an off-by-one bug, since textPoint.LineCharOffset is 1-based (https://docs.microsoft.com/en-us/dotnet/api/envdte.textpoint.linecharoffset?view=visualstudiosdk-2022#remarks):
The reverse GetEditPointForSnapshotPosition method is fine, though, since it adds +1 to return the textPoint.LineCharOffset value.