Skip to content

Fix VS extension interop build - #13

Merged
PhysShell merged 3 commits into
mainfrom
codex/fix-build-failures-after-merge
Jun 4, 2026
Merged

PhysShell merged 3 commits into
mainfrom
codex/fix-build-failures-after-merge

Conversation

@PhysShell

Copy link
Copy Markdown
Owner

Motivation

  • Restore successful compilation of the Visual Studio extension and its integration tests by fixing missing VS interop types and test framework/TFM mismatches introduced after the merge.

Description

  • Added a PackageReference to Microsoft.VisualStudio.Interop in extensions/snipper-vs/Snipper.VisualStudio/Snipper.VisualStudio.csproj to provide IXMLDOMNode and related interop types via NuGet instead of a fragile HintPath.
  • Removed the manual Reference/HintPath to Microsoft.Internal.VisualStudio.Interop.dll from the VSIX project so the interop types resolve from the NuGet package.
  • Updated TabstopInserter.cs to import Microsoft.VisualStudio.Shell.Interop and MSXML so signatures like IVsExpansionClient.GetExpansionFunction(IXMLDOMNode, ...) and the XML COM types compile.
  • Changed the integration test project extensions/snipper-vs/Snipper.VisualStudio.IntegrationTests/Snipper.VisualStudio.IntegrationTests.csproj to target net472, pinned Microsoft.VisualStudio.Sdk.TestFramework.Xunit to 17.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

  • Project files were validated as well-formed XML with ET.parse(...) and the check succeeded for the edited .csproj files.
  • git diff --check passed with no whitespace or conflict markers reported.
  • Attempted dotnet build of the VSIX project could not be run in this environment because dotnet is not installed, so no local compile/test run was performed here.

Codex Task

@PhysShell
PhysShell marked this pull request as ready for review June 4, 2026 11:28
@PhysShell
PhysShell merged commit 2ea155b into main Jun 4, 2026
18 of 19 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant