From d5c67312f619f3283c2c1a448b965d6698da41a5 Mon Sep 17 00:00:00 2001 From: Andy Hanson Date: Mon, 7 Nov 2016 12:41:22 -0800 Subject: [PATCH] Add `realpath` implementation for lshost --- src/server/lsHost.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/server/lsHost.ts b/src/server/lsHost.ts index 628de71bb7a..f1e80d95880 100644 --- a/src/server/lsHost.ts +++ b/src/server/lsHost.ts @@ -13,6 +13,7 @@ namespace ts.server { private readonly resolveModuleName: typeof resolveModuleName; readonly trace: (s: string) => void; + readonly realpath?: (path: string) => string; constructor(private readonly host: ServerHost, private readonly project: Project, private readonly cancellationToken: HostCancellationToken) { this.getCanonicalFileName = ts.createGetCanonicalFileName(this.host.useCaseSensitiveFileNames); @@ -39,6 +40,10 @@ namespace ts.server { } return primaryResult; }; + + if (this.host.realpath) { + this.realpath = path => this.host.realpath(path); + } } public startRecordingFilesWithChangedResolutions() {