Convert legacy safe list keys to lowercase on construction

This commit is contained in:
Andrew Casey 2017-11-20 18:30:28 -08:00
parent cc7b46bb75
commit 9cbe4eb614
2 changed files with 8 additions and 2 deletions

View file

@ -1561,7 +1561,11 @@ namespace ts.projectSystem {
path: "/a/b/foo.js",
content: ""
};
const host = createServerHost([file1, file2, customTypesMap]);
const file3 = {
path: "/a/b/Bacon.js",
content: "let y = 5"
};
const host = createServerHost([file1, file2, file3, customTypesMap]);
const projectService = createProjectService(host);
try {
projectService.openExternalProject({ projectFileName: "project", options: {}, rootFiles: toExternalFiles([file1.path, file2.path]), typeAcquisition: { enable: true } });

View file

@ -527,7 +527,9 @@ namespace ts.server {
}
// raw is now fixed and ready
this.safelist = raw.typesMap;
this.legacySafelist = raw.simpleMap;
for (const key in raw.simpleMap) {
this.legacySafelist[key] = raw.simpleMap[key].toLowerCase();
}
}
catch (e) {
this.logger.info(`Error loading types map: ${e}`);