Remove getDefaultLibFilename from the LS host interface as its result is never honored by the LS.

The LS operate only on a fixed list of files initialized by the host's getScriptFileNames(), if a file is not in this list, it will not be queried from the host, rather considered a missing file. Thus the result of getDefaultLibFilename()is either in the list, or will be ignored.
This commit is contained in:
Mohamed Hegazy
2015-01-14 17:20:27 -08:00
parent adee215e6c
commit 3434aa0bdd
3 changed files with 5 additions and 22 deletions
-4
View File
@@ -217,10 +217,6 @@ module Harness.LanguageService {
return "";
}
public getDefaultLibFilename(): string {
return "";
}
public getScriptFileNames(): string {
var fileNames: string[] = [];
ts.forEachKey(this.fileNameToScript, (fileName) => { fileNames.push(fileName); });
+5 -13
View File
@@ -853,7 +853,6 @@ module ts {
getLocalizedDiagnosticMessages?(): any;
getCancellationToken?(): CancellationToken;
getCurrentDirectory(): string;
getDefaultLibFilename(options: CompilerOptions): string;
log? (s: string): void;
trace? (s: string): void;
error? (s: string): void;
@@ -1964,21 +1963,14 @@ module ts {
function createCompilerHost(): CompilerHost {
return {
getSourceFile: (filename, languageVersion) => {
return getSourceFile(filename);
},
getSourceFile: getSourceFile,
getCancellationToken: () => cancellationToken,
getCanonicalFileName: (filename) => useCaseSensitivefilenames ? filename : filename.toLowerCase(),
getCanonicalFileName: filename => useCaseSensitivefilenames ? filename : filename.toLowerCase(),
useCaseSensitiveFileNames: () => useCaseSensitivefilenames,
getNewLine: () => "\r\n",
getDefaultLibFilename: (options): string => {
return host.getDefaultLibFilename(options);
},
writeFile: (filename, data, writeByteOrderMark) => {
},
getCurrentDirectory: (): string => {
return host.getCurrentDirectory();
}
getDefaultLibFilename: getDefaultLibraryFilename,
writeFile: (filename, data, writeByteOrderMark) => { },
getCurrentDirectory: () => host.getCurrentDirectory()
};
}
-5
View File
@@ -55,7 +55,6 @@ module ts {
getLocalizedDiagnosticMessages(): string;
getCancellationToken(): CancellationToken;
getCurrentDirectory(): string;
getDefaultLibFilename(options: string): string;
}
///
@@ -275,10 +274,6 @@ module ts {
return this.shimHost.getCancellationToken();
}
public getDefaultLibFilename(options: CompilerOptions): string {
return this.shimHost.getDefaultLibFilename(JSON.stringify(options));
}
public getCurrentDirectory(): string {
return this.shimHost.getCurrentDirectory();
}