mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-16 07:13:45 -05:00
Merge pull request #22136 from Microsoft/moduleResolution
Use cache for the non-relative module resolution and enhance the watches for failed lookup locations
This commit is contained in:
@@ -210,6 +210,9 @@ namespace ts.server {
|
||||
/*@internal*/
|
||||
public directoryStructureHost: DirectoryStructureHost;
|
||||
|
||||
/*@internal*/
|
||||
public readonly getCanonicalFileName: GetCanonicalFileName;
|
||||
|
||||
/*@internal*/
|
||||
constructor(
|
||||
/*@internal*/readonly projectName: string,
|
||||
@@ -224,6 +227,7 @@ namespace ts.server {
|
||||
currentDirectory: string | undefined) {
|
||||
this.directoryStructureHost = directoryStructureHost;
|
||||
this.currentDirectory = this.projectService.getNormalizedAbsolutePath(currentDirectory || "");
|
||||
this.getCanonicalFileName = this.projectService.toCanonicalFileName;
|
||||
|
||||
this.cancellationToken = new ThrottledCancellationToken(this.projectService.cancellationToken, this.projectService.throttleWaitMilliseconds);
|
||||
if (!this.compilerOptions) {
|
||||
@@ -238,7 +242,10 @@ namespace ts.server {
|
||||
|
||||
this.setInternalCompilerOptionsForEmittingJsFiles();
|
||||
const host = this.projectService.host;
|
||||
if (host.trace) {
|
||||
if (this.projectService.logger.loggingEnabled()) {
|
||||
this.trace = s => this.writeLog(s);
|
||||
}
|
||||
else if (host.trace) {
|
||||
this.trace = s => host.trace(s);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user