Pick up TS 4.7 for bundling with VS Code
parent
e3e4bfacc3
commit
17ee4c4265
|
@ -52,7 +52,21 @@ function getLanguageServiceHost(scriptKind: ts.ScriptKind) {
|
|||
};
|
||||
},
|
||||
getCurrentDirectory: () => '',
|
||||
getDefaultLibFileName: (_options: ts.CompilerOptions) => 'es6'
|
||||
getDefaultLibFileName: (_options: ts.CompilerOptions) => 'es6',
|
||||
readFile: (path: string, _encoding?: string | undefined): string | undefined => {
|
||||
if (path === currentTextDocument.uri) {
|
||||
return currentTextDocument.getText();
|
||||
} else {
|
||||
return libs.loadLibrary(path);
|
||||
}
|
||||
},
|
||||
fileExists: (path: string): boolean => {
|
||||
if (path === currentTextDocument.uri) {
|
||||
return true;
|
||||
} else {
|
||||
return !!libs.loadLibrary(path);
|
||||
}
|
||||
}
|
||||
};
|
||||
return ts.createLanguageService(host);
|
||||
});
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
"license": "MIT",
|
||||
"description": "Dependencies shared by all extensions",
|
||||
"dependencies": {
|
||||
"typescript": "4.6.3"
|
||||
"typescript": "^4.7.0-dev.20220502"
|
||||
},
|
||||
"scripts": {
|
||||
"postinstall": "node ./postinstall.mjs"
|
||||
|
|
|
@ -59,8 +59,7 @@ class MyCompletionItem extends vscode.CompletionItem {
|
|||
constructor(
|
||||
public readonly position: vscode.Position,
|
||||
public readonly document: vscode.TextDocument,
|
||||
// Intersection needed to avoid type error until TS 4.7.
|
||||
public readonly tsEntry: Proto.CompletionEntry & { labelDetails?: { detail?: string; description?: string } },
|
||||
public readonly tsEntry: Proto.CompletionEntry,
|
||||
private readonly completionContext: CompletionContext,
|
||||
public readonly metadata: any | undefined,
|
||||
client: ITypeScriptServiceClient,
|
||||
|
@ -831,7 +830,6 @@ class TypeScriptCompletionItemProvider implements vscode.CompletionItemProvider<
|
|||
this.telemetryReporter.logTelemetry('completions.execute', {
|
||||
duration: String(duration),
|
||||
type: response?.type ?? 'unknown',
|
||||
// @ts-expect-error until 4.7
|
||||
flags: response?.type === 'response' && typeof response.body?.flags === 'number' ? String(response.body.flags) : undefined,
|
||||
count: String(response?.type === 'response' && response.body ? response.body.entries.length : 0),
|
||||
updateGraphDurationMs: response?.type === 'response' && typeof response.performanceData?.updateGraphDurationMs === 'number'
|
||||
|
|
|
@ -187,7 +187,6 @@ export default class FileConfigurationManager extends Disposable {
|
|||
includeCompletionsForImportStatements: config.get<boolean>('suggest.includeCompletionsForImportStatements', true),
|
||||
includeCompletionsWithSnippetText: config.get<boolean>('suggest.includeCompletionsWithSnippetText', true),
|
||||
includeCompletionsWithClassMemberSnippets: config.get<boolean>('suggest.classMemberSnippets.enabled', true),
|
||||
// @ts-expect-error until 4.7
|
||||
includeCompletionsWithObjectLiteralMethodSnippets: config.get<boolean>('suggest.objectLiteralMethodSnippets.enabled', true),
|
||||
useLabelDetailsInCompletionEntries: true,
|
||||
allowIncompleteCompletions: true,
|
||||
|
|
|
@ -42,10 +42,10 @@ node-gyp-build@^4.3.0:
|
|||
resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.3.0.tgz#9f256b03e5826150be39c764bf51e993946d71a3"
|
||||
integrity sha512-iWjXZvmboq0ja1pUGULQBexmxq8CV4xBhX7VDOTbL7ZR4FOowwY/VOtRxBN/yKxmdGoIp4j5ysNT4u3S2pDQ3Q==
|
||||
|
||||
typescript@4.6.3:
|
||||
version "4.6.3"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.6.3.tgz#eefeafa6afdd31d725584c67a0eaba80f6fc6c6c"
|
||||
integrity sha512-yNIatDa5iaofVozS/uQJEl3JRWLKKGJKh6Yaiv0GLGSuhpFJe7P3SbHZ8/yjAHRQwKRoA6YZqlfjXWmVzoVSMw==
|
||||
typescript@^4.7.0-dev.20220502:
|
||||
version "4.7.0-dev.20220502"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.7.0-dev.20220502.tgz#cd36e6036cc49368aa054182314cb3e070814d4d"
|
||||
integrity sha512-a3YKUJyJ+XBGPsp9NwlqombKF+8Oplg565LaHNYL8p5VdhGJ5M+UR0H6wmLzCx4OhzpT1A8uQtC+f7Fi6TAYsA==
|
||||
|
||||
vscode-grammar-updater@^1.0.4:
|
||||
version "1.0.4"
|
||||
|
|
Loading…
Reference in New Issue