mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-17 01:49:57 -05:00
Merge pull request #18934 from Microsoft/throttledCancellation
Wrap the cancellation token in throttled cancellation token from server
This commit is contained in:
@@ -167,6 +167,8 @@ namespace ts.server {
|
||||
|
||||
private typingFiles: SortedReadonlyArray<string>;
|
||||
|
||||
private readonly cancellationToken: ThrottledCancellationToken;
|
||||
|
||||
public isNonTsProject() {
|
||||
this.updateGraph();
|
||||
return allFilesAreJsOrDts(this);
|
||||
@@ -206,6 +208,7 @@ namespace ts.server {
|
||||
/*@internal*/public directoryStructureHost: DirectoryStructureHost,
|
||||
rootDirectoryForResolution: string | undefined) {
|
||||
|
||||
this.cancellationToken = new ThrottledCancellationToken(this.projectService.cancellationToken, this.projectService.throttleWaitMilliseconds);
|
||||
if (!this.compilerOptions) {
|
||||
this.compilerOptions = getDefaultCompilerOptions();
|
||||
this.compilerOptions.allowNonTsExtensions = true;
|
||||
@@ -294,7 +297,7 @@ namespace ts.server {
|
||||
}
|
||||
|
||||
getCancellationToken() {
|
||||
return this.projectService.cancellationToken;
|
||||
return this.cancellationToken;
|
||||
}
|
||||
|
||||
getCurrentDirectory(): string {
|
||||
|
||||
Reference in New Issue
Block a user