Skip to content

Add realpath implementation for lshost #12089

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
1 commit merged into from
Nov 7, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/server/lsHost.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -39,6 +40,10 @@ namespace ts.server {
}
return primaryResult;
};

if (this.host.realpath) {
this.realpath = path => this.host.realpath(path);
}
}

public startRecordingFilesWithChangedResolutions() {
Expand Down