Skip to content

fix(vscode): use regex for TS extension patching to support VS Code 1.110+#5983

Merged
johnsoncodehk merged 1 commit intovuejs:masterfrom
ebiryu:fix/vscode-find-file-references-issue
Mar 11, 2026
Merged

fix(vscode): use regex for TS extension patching to support VS Code 1.110+#5983
johnsoncodehk merged 1 commit intovuejs:masterfrom
ebiryu:fix/vscode-find-file-references-issue

Conversation

@ebiryu
Copy link
Copy Markdown
Contributor

@ebiryu ebiryu commented Mar 11, 2026

Summary

  • VS Code 1.110 switched its extension build system from tsb to tsgo (Use ts-go for building our extensions microsoft/vscode#292461), changing the minified variable names in the built-in TypeScript extension's dist/extension.js
  • The hardcoded string patterns in patchTypeScriptExtension() no longer matched, causing the monkey-patches to silently fail
  • This broke "Find File References" and other TypeScript features for .vue files, because isSupportedLanguageMode no longer included vue

This PR replaces the four hardcoded string replacements with regex-based patterns that match identifier names regardless of minification, supporting both the old format (t.typescript, t.jsTsLanguageModes) and the new format (bl, Oh).

Fixes #4221 (comment)

@ebiryu ebiryu force-pushed the fix/vscode-find-file-references-issue branch from 8841347 to 84f9e7d Compare March 11, 2026 12:15
@johnsoncodehk
Copy link
Copy Markdown
Member

LGTM, thanks!

@johnsoncodehk johnsoncodehk merged commit 9991d43 into vuejs:master Mar 11, 2026
4 checks passed
@vidal7
Copy link
Copy Markdown

vidal7 commented Mar 17, 2026

Thank you. For users still using Vue 2. Does the 3.0.8 version still working with VS Code 1.110?

@dadigu
Copy link
Copy Markdown

dadigu commented Mar 25, 2026

Thank you. For users still using Vue 2. Does the 3.0.8 version still working with VS Code 1.110?

I can confirm. 3.0.8 does not work with VS Code 1.110+. findAllFileReferences fails with "Unsupported file type". The TS server log shows the plugin loads fine, but the command is rejected client-side before reaching the server.

We're also maintaining a Vue 2.7 app, so upgrading to 3.1+ isn't an option. Would it be possible to backport this fix to a 3.0.x release?

@johnsoncodehk
Copy link
Copy Markdown
Member

You can use @vue/language-server v3.0.x together with the Vue VSCode extension v3.2.6 for compatibility, see https://github.com/vuejs/language-tools/wiki/Vue-2-Compat-Guides.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

File Explorer "Find File References" not working for .vue SFC

4 participants