mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
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:
@@ -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); });
|
||||
|
||||
@@ -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()
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user