Skip to content
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: support for "JavaScript and TypeScript Nightly" #1629

Merged
merged 2 commits into from Jul 25, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 12 additions & 0 deletions extensions/vscode-vue-language-features/src/features/tsVersion.ts
@@ -1,3 +1,4 @@
import * as path from 'path';
import * as vscode from 'vscode';
import { BaseLanguageClient } from 'vscode-languageclient';
import * as shared from '@volar/shared';
Expand Down Expand Up @@ -148,6 +149,17 @@ function getWorkspaceTsPaths(useDefault = false) {
}

function getVscodeTsPaths() {
const nightly = vscode.extensions.getExtension('ms-vscode.vscode-typescript-next');
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It seems that user can only select nightly version when user install ms-vscode.vscode-typescript-next extension. They can't select the builtin typescript version.

Copy link
Member

Choose a reason for hiding this comment

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

It's for consistent with VSCode behavior, because seems VSCode cannot select it too.

if (nightly) {
const tsLibPath = path.join(nightly.extensionPath, 'node_modules/typescript/lib');
const serverPath = shared.findTypescriptModulePathInLib(tsLibPath);
if (serverPath) {
return {
serverPath,
localizedPath: shared.findTypescriptLocalizedPathInLib(tsLibPath, vscode.env.language)
};
}
}
return {
serverPath: shared.getVscodeTypescriptPath(vscode.env.appRoot),
localizedPath: shared.getVscodeTypescriptLocalizedPath(vscode.env.appRoot, vscode.env.language),
Expand Down