Skip to content

Commit

Permalink
support untyped imports in shims (#13758)
Browse files Browse the repository at this point in the history
  • Loading branch information
vladima authored Jan 30, 2017
1 parent d38bc54 commit 9b6f930
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/services/shims.ts
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,10 @@ namespace ts {
if (settingsJson == null || settingsJson == "") {
throw Error("LanguageServiceShimHostAdapter.getCompilationSettings: empty compilationSettings");
}
return <CompilerOptions>JSON.parse(settingsJson);
const compilerOptions = <CompilerOptions>JSON.parse(settingsJson);
// permit language service to handle all files (filtering should be performed on the host side)
compilerOptions.allowNonTsExtensions = true;
return compilerOptions;
}

public getScriptFileNames(): string[] {
Expand Down Expand Up @@ -1061,12 +1064,6 @@ namespace ts {
const compilerOptions = <CompilerOptions>JSON.parse(compilerOptionsJson);
const result = resolveModuleName(moduleName, normalizeSlashes(fileName), compilerOptions, this.host);
const resolvedFileName = result.resolvedModule ? result.resolvedModule.resolvedFileName : undefined;
if (resolvedFileName && !compilerOptions.allowJs && fileExtensionIs(resolvedFileName, ".js")) {
return {
resolvedFileName: undefined,
failedLookupLocations: []
};
}
return {
resolvedFileName,
failedLookupLocations: result.failedLookupLocations
Expand Down

0 comments on commit 9b6f930

Please sign in to comment.