Repository navigation
Fix VS extension interop build - #13
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fe5a5cfaef
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| iEndLine = line, | ||
| iEndIndex = col, | ||
| }; | ||
| dom.loadXML(xml); |
There was a problem hiding this comment.
Strip the encoding declaration before loadXML
When running in Visual Studio on Windows, ToVsSnippetXml always prefixes the snippet with <?xml version="1.0" encoding="utf-8"?>, but loadXML receives a managed/COM BSTR (UTF-16). MSXML rejects XML strings whose declaration switches to UTF-8, so this call leaves the DOM empty/invalid and InsertSpecificExpansion is handed a document without the snippet, making tabstop insertion fail for normal snippets. Either remove/adjust the XML declaration for in-memory parsing or load the actual UTF-8 bytes/stream as before, and check the loadXML result before returning the DOM.
Useful? React with 👍 / 👎.
Motivation
Description
PackageReferencetoMicrosoft.VisualStudio.Interopinextensions/snipper-vs/Snipper.VisualStudio/Snipper.VisualStudio.csprojto provideIXMLDOMNodeand related interop types via NuGet instead of a fragileHintPath.Reference/HintPathtoMicrosoft.Internal.VisualStudio.Interop.dllfrom the VSIX project so the interop types resolve from the NuGet package.TabstopInserter.csto importMicrosoft.VisualStudio.Shell.InteropandMSXMLso signatures likeIVsExpansionClient.GetExpansionFunction(IXMLDOMNode, ...)and the XML COM types compile.extensions/snipper-vs/Snipper.VisualStudio.IntegrationTests/Snipper.VisualStudio.IntegrationTests.csprojto targetnet472, pinnedMicrosoft.VisualStudio.Sdk.TestFramework.Xunitto17.11.66, enabled binding redirect generation, and removed the brittle VSSDK BuildTools/HintPath workaround so the test framework and VS interop assets match the in-proc VSIX runtime.Testing
ET.parse(...)and the check succeeded for the edited.csprojfiles.git diff --checkpassed with no whitespace or conflict markers reported.dotnet buildof the VSIX project could not be run in this environment becausedotnetis not installed, so no local compile/test run was performed here.Codex Task