Small cleanup

This commit is contained in:
Matt Bierner
2025-10-13 08:16:58 -07:00
parent cc51a6897a
commit 052d769933
2 changed files with 8 additions and 9 deletions

View File

@@ -52,14 +52,14 @@ class TypeScriptLanguageServiceHost {
getCurrentDirectory() { getCurrentDirectory() {
return ''; return '';
} }
getDefaultLibFileName(_options) { getDefaultLibFileName(options) {
return this.ts.getDefaultLibFilePath(_options); return this.ts.getDefaultLibFilePath(options);
} }
readFile(path, _encoding) { readFile(path, encoding) {
if (this.topLevelFiles.get(path)) { if (this.topLevelFiles.get(path)) {
return 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) { fileExists(path) {
if (this.topLevelFiles.has(path)) { if (this.topLevelFiles.has(path)) {

View File

@@ -5,7 +5,6 @@
import ts from 'typescript'; import ts from 'typescript';
import fs from 'node:fs'; import fs from 'node:fs';
// import path from 'node:path';
export type IFileMap = Map</*fileName*/ string, string>; export type IFileMap = Map</*fileName*/ string, string>;
@@ -49,14 +48,14 @@ export class TypeScriptLanguageServiceHost implements ts.LanguageServiceHost {
getCurrentDirectory(): string { getCurrentDirectory(): string {
return ''; return '';
} }
getDefaultLibFileName(_options: ts.CompilerOptions): string { getDefaultLibFileName(options: ts.CompilerOptions): string {
return this.ts.getDefaultLibFilePath(_options); return this.ts.getDefaultLibFilePath(options);
} }
readFile(path: string, _encoding?: string): string | undefined { readFile(path: string, encoding?: string): string | undefined {
if (this.topLevelFiles.get(path)) { if (this.topLevelFiles.get(path)) {
return 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 { fileExists(path: string): boolean {
if (this.topLevelFiles.has(path)) { if (this.topLevelFiles.has(path)) {