The stx TypeScript server plugin never loads. contributes.typescriptServerPlugins named it by file path, ./dist/typescript-stx-plugin.js, and tsserver only loads plugins by package name. VS Code 1.128.1 (TypeScript 6.0.3), running the extension against a scratch project with typescript.tsserver.log: verbose, logs:
Loading global plugin ./dist/typescript-stx-plugin.js
Enabling plugin ./dist/typescript-stx-plugin.js from candidate paths: <extension>,...
Skipped loading plugin ./dist/typescript-stx-plugin.js because only package name is allowed plugin nameA second fault was hidden behind it: the bundle came from export default init, so module.exports was { default: init }. tsserver calls module.exports directly and would have skipped it as "did not expose a proper factory function".
Fix:
- contribute the plugin as the package
@stacksjs/stx-typescript-plugin, which tsserver resolves from<extension>/node_modules(the probe location VS Code passes) - the build writes that package (a forwarder to
dist/typescript-stx-plugin.js) and bundles the plugin through an entry that setsmodule.exportsto the factory vsce package --no-dependenciesleaves out everything undernode_modules, soscripts/package.tsadds the package to the VSIX after vsce writes it, andreleasepublishes that VSIX
With the fix, the same VS Code logs Loading @stacksjs/stx-typescript-plugin from <extension> ... [stx-plugin] TypeScript stx plugin initialized ... Plugin validation succeeded, both from --extensionDevelopmentPath and from the packaged VSIX installed into a clean extensions dir.