-
-
Notifications
You must be signed in to change notification settings - Fork 415
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: migrate to TS plugin and deprecate takeover mode #3788
Conversation
try { | ||
const tsExtension = vscode.extensions.getExtension('vscode.typescript-language-features')!; | ||
const readFileSync = fs.readFileSync; | ||
const extensionJsPath = require.resolve('./dist/extension.js', { paths: [tsExtension.extensionPath] }); | ||
|
||
// @ts-expect-error | ||
fs.readFileSync = (...args) => { | ||
if (args[0] === extensionJsPath) { | ||
// @ts-expect-error | ||
let text = readFileSync(...args) as string; | ||
|
||
// patch jsTsLanguageModes | ||
text = text.replace('t.$u=[t.$r,t.$s,t.$p,t.$q]', s => s + '.concat("vue")'); | ||
|
||
// patch isSupportedLanguageMode | ||
text = text.replace('s.languages.match([t.$p,t.$q,t.$r,t.$s]', s => s + '.concat("vue")'); | ||
|
||
return text; | ||
} | ||
// @ts-expect-error | ||
return readFileSync(...args); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you tried submitting some fix for that in VSCode repo? This looks like something that nobody should be allowed to do ;)
I suppose it would likely make sense if vscode would also consider languages
declared by a plugin when showing the status field?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll leave it to VSCode team to decide how to implement it, please track microsoft/vscode#200511
6e48cec
to
7b47792
Compare
0055fb1
to
cb09244
Compare
f1ce889
to
9f1950d
Compare
520a733
to
3053cf1
Compare
Since the parallel development of three branches (v1, master, ts-plugin) is almost impossible to maintain, I will first merge the ts-plugin branch to master and develop 2.0 on the master branch. 1.x is still maintained by the v1 branch and rebased to master when needed. |
Does this commit suggest that we should not use the takeover mode in the future? |
There will be no takeover mode in the future :) |
EDIT: I found a fix. You can disregard my cry for help. I'm trying to upgrade my setup to account for this change, but I'm a bit stuck. The only relevant documentation that I've found it this single line in the changelog: Line 48 in 3793058
The plugin mentioned here is a plugin for volar or a plugin for tsserver? My initial impression is that it was a plugin for volar, but some comments lead to to understand that it's a plugin for`tsserver instead. Does I've tried various approaches, but none seemed to work for me. There's ongoing discussion in #3925, and feedback from those familiar with how this is intended to be used would be most useful. |
@WhyNotHugo Thanks for your help in the thread. ❤️ (I can't actually help, I have no idea about nvim.) |
@gegoune: Fix working solution is in this comment: #3925 (comment) The issue was in how plugins are configured for typescript-language-server. The @johnsoncodehk The above hints are not neovim-specific; they are relevant for people setting up the plugin on any LSP client (the exact syntax will vary a bit from one to another). |
@WhyNotHugo It would be great if you are willing to open a PR to add configuration methods to the readme of @vue/typescript-vue and @vue/language-server. |
Docs for the plugin here: #3974 |
Feedback: #3789
close #2467, close #3423, close #3186, close #2746, close #2731, close #2721, close #1245, close #2361, close #2442, close #2490, close #2612, close #2603, close #2534, close #2747, close #3232, close #1277, close #918, close #3229, close #3482, close #3355, close #3545, close #3508, close #3680, close #3678, close #3741, close #3192, close #3740, close #3776, close #3391, close #3329, close #3788, close #3231, close #3788, close #3801
Commands
Editor Features
Bug Fixes
Optimize
Regressions