Skip to content
Prev Previous commit
Next Next commit
Change the key for looking up automatic type-directives
  • Loading branch information
Kanchalai Tanglertsampan committed Jul 21, 2016
commit 11e3821c3329919f0a7b30c2af8bae378ae9ab5a
4 changes: 2 additions & 2 deletions src/compiler/program.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1158,8 +1158,8 @@ namespace ts {
const typeReferences: string[] = getAutomaticTypeDirectiveNames(options, host);

if (typeReferences) {
const inferredRoot = getInferredTypesRoot(options, rootNames, host);
const containingFilename = combinePaths(inferredRoot, "__inferred type names__.ts");
// This containgFilename needs to matched with the one used in managed-side
Copy link

@giannic giannic Jul 26, 2016

Choose a reason for hiding this comment

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

nit: matched -> match and containgFilename -> containingFilename

const containingFilename = "__inferred type names__.ts"
Copy link
Contributor

@vladima vladima Jul 21, 2016

Choose a reason for hiding this comment

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

does it work in VSCode? since this name is now always relative

Copy link
Contributor Author

Choose a reason for hiding this comment

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

From talking off line, this is incorrect as it will not be unique to the project of interest. IT will be problematic if more than one project is open. The fix is to use host.getCurrentDirectory()

const resolutions = resolveTypeReferenceDirectiveNamesWorker(typeReferences, containingFilename);
for (let i = 0; i < typeReferences.length; i++) {
processTypeReferenceDirective(typeReferences[i], resolutions[i]);
Expand Down