Skip to content

Commit 3434aa0

Browse files
committed
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.
1 parent adee215 commit 3434aa0

3 files changed

Lines changed: 5 additions & 22 deletions

File tree

src/harness/harnessLanguageService.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,10 +217,6 @@ module Harness.LanguageService {
217217
return "";
218218
}
219219

220-
public getDefaultLibFilename(): string {
221-
return "";
222-
}
223-
224220
public getScriptFileNames(): string {
225221
var fileNames: string[] = [];
226222
ts.forEachKey(this.fileNameToScript, (fileName) => { fileNames.push(fileName); });

src/services/services.ts

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,6 @@ module ts {
853853
getLocalizedDiagnosticMessages?(): any;
854854
getCancellationToken?(): CancellationToken;
855855
getCurrentDirectory(): string;
856-
getDefaultLibFilename(options: CompilerOptions): string;
857856
log? (s: string): void;
858857
trace? (s: string): void;
859858
error? (s: string): void;
@@ -1964,21 +1963,14 @@ module ts {
19641963

19651964
function createCompilerHost(): CompilerHost {
19661965
return {
1967-
getSourceFile: (filename, languageVersion) => {
1968-
return getSourceFile(filename);
1969-
},
1966+
getSourceFile: getSourceFile,
19701967
getCancellationToken: () => cancellationToken,
1971-
getCanonicalFileName: (filename) => useCaseSensitivefilenames ? filename : filename.toLowerCase(),
1968+
getCanonicalFileName: filename => useCaseSensitivefilenames ? filename : filename.toLowerCase(),
19721969
useCaseSensitiveFileNames: () => useCaseSensitivefilenames,
19731970
getNewLine: () => "\r\n",
1974-
getDefaultLibFilename: (options): string => {
1975-
return host.getDefaultLibFilename(options);
1976-
},
1977-
writeFile: (filename, data, writeByteOrderMark) => {
1978-
},
1979-
getCurrentDirectory: (): string => {
1980-
return host.getCurrentDirectory();
1981-
}
1971+
getDefaultLibFilename: getDefaultLibraryFilename,
1972+
writeFile: (filename, data, writeByteOrderMark) => { },
1973+
getCurrentDirectory: () => host.getCurrentDirectory()
19821974
};
19831975
}
19841976

src/services/shims.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ module ts {
5555
getLocalizedDiagnosticMessages(): string;
5656
getCancellationToken(): CancellationToken;
5757
getCurrentDirectory(): string;
58-
getDefaultLibFilename(options: string): string;
5958
}
6059

6160
///
@@ -275,10 +274,6 @@ module ts {
275274
return this.shimHost.getCancellationToken();
276275
}
277276

278-
public getDefaultLibFilename(options: CompilerOptions): string {
279-
return this.shimHost.getDefaultLibFilename(JSON.stringify(options));
280-
}
281-
282277
public getCurrentDirectory(): string {
283278
return this.shimHost.getCurrentDirectory();
284279
}

0 commit comments

Comments
 (0)