mirror of
https://github.com/microsoft/vscode.git
synced 2026-02-15 07:28:05 +00:00
Small cleanup
This commit is contained in:
@@ -52,14 +52,14 @@ class TypeScriptLanguageServiceHost {
|
||||
getCurrentDirectory() {
|
||||
return '';
|
||||
}
|
||||
getDefaultLibFileName(_options) {
|
||||
return this.ts.getDefaultLibFilePath(_options);
|
||||
getDefaultLibFileName(options) {
|
||||
return this.ts.getDefaultLibFilePath(options);
|
||||
}
|
||||
readFile(path, _encoding) {
|
||||
readFile(path, encoding) {
|
||||
if (this.topLevelFiles.get(path)) {
|
||||
return this.topLevelFiles.get(path);
|
||||
}
|
||||
return typescript_1.default.sys.readFile(path, _encoding);
|
||||
return typescript_1.default.sys.readFile(path, encoding);
|
||||
}
|
||||
fileExists(path) {
|
||||
if (this.topLevelFiles.has(path)) {
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
|
||||
import ts from 'typescript';
|
||||
import fs from 'node:fs';
|
||||
// import path from 'node:path';
|
||||
|
||||
export type IFileMap = Map</*fileName*/ string, string>;
|
||||
|
||||
@@ -49,14 +48,14 @@ export class TypeScriptLanguageServiceHost implements ts.LanguageServiceHost {
|
||||
getCurrentDirectory(): string {
|
||||
return '';
|
||||
}
|
||||
getDefaultLibFileName(_options: ts.CompilerOptions): string {
|
||||
return this.ts.getDefaultLibFilePath(_options);
|
||||
getDefaultLibFileName(options: ts.CompilerOptions): string {
|
||||
return this.ts.getDefaultLibFilePath(options);
|
||||
}
|
||||
readFile(path: string, _encoding?: string): string | undefined {
|
||||
readFile(path: string, encoding?: string): string | undefined {
|
||||
if (this.topLevelFiles.get(path)) {
|
||||
return this.topLevelFiles.get(path);
|
||||
}
|
||||
return ts.sys.readFile(path, _encoding);
|
||||
return ts.sys.readFile(path, encoding);
|
||||
}
|
||||
fileExists(path: string): boolean {
|
||||
if (this.topLevelFiles.has(path)) {
|
||||
|
||||
Reference in New Issue
Block a user