Skip to content

Commit

Permalink
Support inferred TS/JS project per root
Browse files Browse the repository at this point in the history
Fixes #30414
  • Loading branch information
mjbvz committed Aug 23, 2017
1 parent 8d9778b commit 949b9f1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
9 changes: 7 additions & 2 deletions extensions/typescript/src/typescriptServiceClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand Down Expand Up @@ -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;
}
}
Expand Down
4 changes: 4 additions & 0 deletions extensions/typescript/src/utils/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
}

0 comments on commit 949b9f1

Please sign in to comment.