提交 949b9f1a 编写于 作者: M Matt Bierner

Support inferred TS/JS project per root

Fixes #30414
上级 8d9778b1
......@@ -331,7 +331,12 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient
const args: string[] = [];
if (this.apiVersion.has206Features()) {
args.push('--useSingleInferredProject');
if (this.apiVersion.has250Features()) {
args.push('--useInferredProjectPerProjectRoot');
} else {
args.push('--useSingleInferredProject');
}
if (this.configuration.disableAutomaticTypeAcquisition) {
args.push('--disableAutomaticTypingAcquisition');
}
......@@ -614,7 +619,7 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient
if (resource.scheme === 'file' || resource.scheme === 'untitled') {
for (const root of roots.sort((a, b) => a.uri.fsPath.length - b.uri.fsPath.length)) {
if (resource.fsPath.startsWith(root.uri.fsPath)) {
if (resource.fsPath.startsWith(root.uri.fsPath + path.sep)) {
return root.uri.fsPath;
}
}
......
......@@ -65,4 +65,8 @@ export default class API {
public has240Features(): boolean {
return semver.gte(this.version, '2.4.0');
}
public has250Features(): boolean {
return semver.gte(this.version, '2.5.0');
}
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册