typescript-language-server 3.0.1 → 3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/lib/cli.mjs +3 -0
- package/lib/cli.mjs.map +1 -0
- package/package.json +37 -31
- package/lib/cli.d.ts +0 -3
- package/lib/cli.d.ts.map +0 -1
- package/lib/cli.js +0 -37
- package/lib/cli.js.map +0 -1
- package/lib/commands.d.ts +0 -13
- package/lib/commands.d.ts.map +0 -1
- package/lib/commands.js +0 -20
- package/lib/commands.js.map +0 -1
- package/lib/completion.d.ts +0 -10
- package/lib/completion.d.ts.map +0 -1
- package/lib/completion.js +0 -388
- package/lib/completion.js.map +0 -1
- package/lib/configuration-manager.d.ts +0 -48
- package/lib/configuration-manager.d.ts.map +0 -1
- package/lib/configuration-manager.js +0 -138
- package/lib/configuration-manager.js.map +0 -1
- package/lib/diagnostic-queue.d.ts +0 -31
- package/lib/diagnostic-queue.d.ts.map +0 -1
- package/lib/diagnostic-queue.js +0 -70
- package/lib/diagnostic-queue.js.map +0 -1
- package/lib/document-symbol.d.ts +0 -6
- package/lib/document-symbol.d.ts.map +0 -1
- package/lib/document-symbol.js +0 -85
- package/lib/document-symbol.js.map +0 -1
- package/lib/document.d.ts +0 -34
- package/lib/document.d.ts.map +0 -1
- package/lib/document.js +0 -115
- package/lib/document.js.map +0 -1
- package/lib/features/call-hierarchy.d.ts +0 -7
- package/lib/features/call-hierarchy.d.ts.map +0 -1
- package/lib/features/call-hierarchy.js +0 -81
- package/lib/features/call-hierarchy.js.map +0 -1
- package/lib/features/call-hierarchy.spec.d.ts +0 -2
- package/lib/features/call-hierarchy.spec.d.ts.map +0 -1
- package/lib/features/call-hierarchy.spec.js +0 -107
- package/lib/features/call-hierarchy.spec.js.map +0 -1
- package/lib/features/fix-all.d.ts +0 -12
- package/lib/features/fix-all.d.ts.map +0 -1
- package/lib/features/fix-all.js +0 -156
- package/lib/features/fix-all.js.map +0 -1
- package/lib/features/inlay-hints.d.ts +0 -11
- package/lib/features/inlay-hints.d.ts.map +0 -1
- package/lib/features/inlay-hints.js +0 -71
- package/lib/features/inlay-hints.js.map +0 -1
- package/lib/features/semantic-tokens.d.ts +0 -9
- package/lib/features/semantic-tokens.d.ts.map +0 -1
- package/lib/features/semantic-tokens.js +0 -43
- package/lib/features/semantic-tokens.js.map +0 -1
- package/lib/features/source-definition.d.ts +0 -11
- package/lib/features/source-definition.d.ts.map +0 -1
- package/lib/features/source-definition.js +0 -51
- package/lib/features/source-definition.js.map +0 -1
- package/lib/file-lsp-server.spec.d.ts +0 -2
- package/lib/file-lsp-server.spec.d.ts.map +0 -1
- package/lib/file-lsp-server.spec.js +0 -64
- package/lib/file-lsp-server.spec.js.map +0 -1
- package/lib/hover.d.ts +0 -6
- package/lib/hover.d.ts.map +0 -1
- package/lib/hover.js +0 -80
- package/lib/hover.js.map +0 -1
- package/lib/lsp-client.d.ts +0 -26
- package/lib/lsp-client.d.ts.map +0 -1
- package/lib/lsp-client.js +0 -51
- package/lib/lsp-client.js.map +0 -1
- package/lib/lsp-connection.d.ts +0 -9
- package/lib/lsp-connection.d.ts.map +0 -1
- package/lib/lsp-connection.js +0 -54
- package/lib/lsp-connection.js.map +0 -1
- package/lib/lsp-server.d.ts +0 -86
- package/lib/lsp-server.d.ts.map +0 -1
- package/lib/lsp-server.js +0 -1168
- package/lib/lsp-server.js.map +0 -1
- package/lib/lsp-server.spec.d.ts +0 -2
- package/lib/lsp-server.spec.d.ts.map +0 -1
- package/lib/lsp-server.spec.js +0 -2106
- package/lib/lsp-server.spec.js.map +0 -1
- package/lib/organize-imports.d.ts +0 -5
- package/lib/organize-imports.d.ts.map +0 -1
- package/lib/organize-imports.js +0 -19
- package/lib/organize-imports.js.map +0 -1
- package/lib/organize-imports.spec.d.ts +0 -2
- package/lib/organize-imports.spec.d.ts.map +0 -1
- package/lib/organize-imports.spec.js +0 -38
- package/lib/organize-imports.spec.js.map +0 -1
- package/lib/protocol-translation.d.ts +0 -26
- package/lib/protocol-translation.d.ts.map +0 -1
- package/lib/protocol-translation.js +0 -184
- package/lib/protocol-translation.js.map +0 -1
- package/lib/quickfix.d.ts +0 -5
- package/lib/quickfix.d.ts.map +0 -1
- package/lib/quickfix.js +0 -20
- package/lib/quickfix.js.map +0 -1
- package/lib/refactor.d.ts +0 -6
- package/lib/refactor.d.ts.map +0 -1
- package/lib/refactor.js +0 -58
- package/lib/refactor.js.map +0 -1
- package/lib/test-utils.d.ts +0 -45
- package/lib/test-utils.d.ts.map +0 -1
- package/lib/test-utils.js +0 -185
- package/lib/test-utils.js.map +0 -1
- package/lib/ts-protocol.d.ts +0 -93
- package/lib/ts-protocol.d.ts.map +0 -1
- package/lib/ts-protocol.js +0 -66
- package/lib/ts-protocol.js.map +0 -1
- package/lib/tsServer/callbackMap.d.ts +0 -17
- package/lib/tsServer/callbackMap.d.ts.map +0 -1
- package/lib/tsServer/callbackMap.js +0 -47
- package/lib/tsServer/callbackMap.js.map +0 -1
- package/lib/tsServer/cancellation.d.ts +0 -22
- package/lib/tsServer/cancellation.d.ts.map +0 -1
- package/lib/tsServer/cancellation.js +0 -51
- package/lib/tsServer/cancellation.js.map +0 -1
- package/lib/tsServer/logDirectoryProvider.d.ts +0 -13
- package/lib/tsServer/logDirectoryProvider.d.ts.map +0 -1
- package/lib/tsServer/logDirectoryProvider.js +0 -49
- package/lib/tsServer/logDirectoryProvider.js.map +0 -1
- package/lib/tsServer/requestQueue.d.ts +0 -34
- package/lib/tsServer/requestQueue.d.ts.map +0 -1
- package/lib/tsServer/requestQueue.js +0 -74
- package/lib/tsServer/requestQueue.js.map +0 -1
- package/lib/tsServer/requests.d.ts +0 -73
- package/lib/tsServer/requests.d.ts.map +0 -1
- package/lib/tsServer/requests.js +0 -30
- package/lib/tsServer/requests.js.map +0 -1
- package/lib/tsServer/server.d.ts +0 -100
- package/lib/tsServer/server.d.ts.map +0 -1
- package/lib/tsServer/server.js +0 -216
- package/lib/tsServer/server.js.map +0 -1
- package/lib/tsServer/serverError.d.ts +0 -18
- package/lib/tsServer/serverError.d.ts.map +0 -1
- package/lib/tsServer/serverError.js +0 -53
- package/lib/tsServer/serverError.js.map +0 -1
- package/lib/tsServer/serverProcess.d.ts +0 -7
- package/lib/tsServer/serverProcess.d.ts.map +0 -1
- package/lib/tsServer/serverProcess.js +0 -244
- package/lib/tsServer/serverProcess.js.map +0 -1
- package/lib/tsServer/spawner.d.ts +0 -19
- package/lib/tsServer/spawner.d.ts.map +0 -1
- package/lib/tsServer/spawner.js +0 -130
- package/lib/tsServer/spawner.js.map +0 -1
- package/lib/tsServer/tracer.d.ts +0 -26
- package/lib/tsServer/tracer.d.ts.map +0 -1
- package/lib/tsServer/tracer.js +0 -80
- package/lib/tsServer/tracer.js.map +0 -1
- package/lib/tsServer/versionProvider.d.ts +0 -29
- package/lib/tsServer/versionProvider.d.ts.map +0 -1
- package/lib/tsServer/versionProvider.js +0 -161
- package/lib/tsServer/versionProvider.js.map +0 -1
- package/lib/tsp-client.d.ts +0 -53
- package/lib/tsp-client.d.ts.map +0 -1
- package/lib/tsp-client.js +0 -228
- package/lib/tsp-client.js.map +0 -1
- package/lib/tsp-client.spec.d.ts +0 -2
- package/lib/tsp-client.spec.d.ts.map +0 -1
- package/lib/tsp-client.spec.js +0 -113
- package/lib/tsp-client.spec.js.map +0 -1
- package/lib/utils/MarkdownString.d.ts +0 -15
- package/lib/utils/MarkdownString.d.ts.map +0 -1
- package/lib/utils/MarkdownString.js +0 -45
- package/lib/utils/MarkdownString.js.map +0 -1
- package/lib/utils/SnippetString.d.ts +0 -12
- package/lib/utils/SnippetString.d.ts.map +0 -1
- package/lib/utils/SnippetString.js +0 -66
- package/lib/utils/SnippetString.js.map +0 -1
- package/lib/utils/api.d.ts +0 -49
- package/lib/utils/api.d.ts.map +0 -1
- package/lib/utils/api.js +0 -77
- package/lib/utils/api.js.map +0 -1
- package/lib/utils/configuration.d.ts +0 -20
- package/lib/utils/configuration.d.ts.map +0 -1
- package/lib/utils/configuration.js +0 -47
- package/lib/utils/configuration.js.map +0 -1
- package/lib/utils/errorCodes.d.ts +0 -12
- package/lib/utils/errorCodes.d.ts.map +0 -1
- package/lib/utils/errorCodes.js +0 -16
- package/lib/utils/errorCodes.js.map +0 -1
- package/lib/utils/fixNames.d.ts +0 -14
- package/lib/utils/fixNames.d.ts.map +0 -1
- package/lib/utils/fixNames.js +0 -18
- package/lib/utils/fixNames.js.map +0 -1
- package/lib/utils/logger.d.ts +0 -65
- package/lib/utils/logger.d.ts.map +0 -1
- package/lib/utils/logger.js +0 -187
- package/lib/utils/logger.js.map +0 -1
- package/lib/utils/modules-resolver.d.ts +0 -2
- package/lib/utils/modules-resolver.d.ts.map +0 -1
- package/lib/utils/modules-resolver.js +0 -17
- package/lib/utils/modules-resolver.js.map +0 -1
- package/lib/utils/modules-resolver.spec.d.ts +0 -2
- package/lib/utils/modules-resolver.spec.d.ts.map +0 -1
- package/lib/utils/modules-resolver.spec.js +0 -18
- package/lib/utils/modules-resolver.spec.js.map +0 -1
- package/lib/utils/previewer.d.ts +0 -15
- package/lib/utils/previewer.d.ts.map +0 -1
- package/lib/utils/previewer.js +0 -185
- package/lib/utils/previewer.js.map +0 -1
- package/lib/utils/previewer.spec.d.ts +0 -2
- package/lib/utils/previewer.spec.d.ts.map +0 -1
- package/lib/utils/previewer.spec.js +0 -123
- package/lib/utils/previewer.spec.js.map +0 -1
- package/lib/utils/tsconfig.d.ts +0 -4
- package/lib/utils/tsconfig.d.ts.map +0 -1
- package/lib/utils/tsconfig.js +0 -41
- package/lib/utils/tsconfig.js.map +0 -1
- package/lib/utils/typeConverters.d.ts +0 -29
- package/lib/utils/typeConverters.d.ts.map +0 -1
- package/lib/utils/typeConverters.js +0 -118
- package/lib/utils/typeConverters.js.map +0 -1
- package/lib/utils/types.d.ts +0 -41
- package/lib/utils/types.d.ts.map +0 -1
- package/lib/utils/types.js +0 -55
- package/lib/utils/types.js.map +0 -1
- package/lib/utils.d.ts +0 -6
- package/lib/utils.d.ts.map +0 -1
- package/lib/utils.js +0 -17
- package/lib/utils.js.map +0 -1
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
/*
|
|
6
|
-
* Copyright (C) 2022 TypeFox and others.
|
|
7
|
-
*
|
|
8
|
-
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
|
|
9
|
-
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*/
|
|
11
|
-
export var RequestQueueingType;
|
|
12
|
-
(function (RequestQueueingType) {
|
|
13
|
-
/**
|
|
14
|
-
* Normal request that is executed in order.
|
|
15
|
-
*/
|
|
16
|
-
RequestQueueingType[RequestQueueingType["Normal"] = 1] = "Normal";
|
|
17
|
-
/**
|
|
18
|
-
* Request that normal requests jump in front of in the queue.
|
|
19
|
-
*/
|
|
20
|
-
RequestQueueingType[RequestQueueingType["LowPriority"] = 2] = "LowPriority";
|
|
21
|
-
/**
|
|
22
|
-
* A fence that blocks request reordering.
|
|
23
|
-
*
|
|
24
|
-
* Fences are not reordered. Unlike a normal request, a fence will never jump in front of a low priority request
|
|
25
|
-
* in the request queue.
|
|
26
|
-
*/
|
|
27
|
-
RequestQueueingType[RequestQueueingType["Fence"] = 3] = "Fence";
|
|
28
|
-
})(RequestQueueingType = RequestQueueingType || (RequestQueueingType = {}));
|
|
29
|
-
export class RequestQueue {
|
|
30
|
-
constructor() {
|
|
31
|
-
this.queue = [];
|
|
32
|
-
this.sequenceNumber = 0;
|
|
33
|
-
}
|
|
34
|
-
get length() {
|
|
35
|
-
return this.queue.length;
|
|
36
|
-
}
|
|
37
|
-
enqueue(item) {
|
|
38
|
-
if (item.queueingType === RequestQueueingType.Normal) {
|
|
39
|
-
let index = this.queue.length - 1;
|
|
40
|
-
while (index >= 0) {
|
|
41
|
-
if (this.queue[index].queueingType !== RequestQueueingType.LowPriority) {
|
|
42
|
-
break;
|
|
43
|
-
}
|
|
44
|
-
--index;
|
|
45
|
-
}
|
|
46
|
-
this.queue.splice(index + 1, 0, item);
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
// Only normal priority requests can be reordered. All other requests just go to the end.
|
|
50
|
-
this.queue.push(item);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
dequeue() {
|
|
54
|
-
return this.queue.shift();
|
|
55
|
-
}
|
|
56
|
-
tryDeletePendingRequest(seq) {
|
|
57
|
-
for (let i = 0; i < this.queue.length; i++) {
|
|
58
|
-
if (this.queue[i].request.seq === seq) {
|
|
59
|
-
this.queue.splice(i, 1);
|
|
60
|
-
return true;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
return false;
|
|
64
|
-
}
|
|
65
|
-
createRequest(command, args) {
|
|
66
|
-
return {
|
|
67
|
-
seq: this.sequenceNumber++,
|
|
68
|
-
type: 'request',
|
|
69
|
-
command: command,
|
|
70
|
-
arguments: args,
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
//# sourceMappingURL=requestQueue.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"requestQueue.js","sourceRoot":"","sources":["../../src/tsServer/requestQueue.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;;;;GAKG;AAIH,MAAM,CAAN,IAAY,mBAkBX;AAlBD,WAAY,mBAAmB;IAC3B;;OAEG;IACH,iEAAU,CAAA;IAEV;;OAEG;IACH,2EAAe,CAAA;IAEf;;;;;OAKG;IACH,+DAAS,CAAA;AACb,CAAC,EAlBW,mBAAmB,GAAnB,mBAAmB,KAAnB,mBAAmB,QAkB9B;AASD,MAAM,OAAO,YAAY;IAAzB;QACqB,UAAK,GAAkB,EAAE,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f,OAAO,EAAE,OAAO;YAChB,SAAS,EAAE,IAAI;SAClB,CAAC;IACN,CAAC;CACJ"}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import vscodeUri from 'vscode-uri';
|
|
2
|
-
import { tsp } from '../ts-protocol.js';
|
|
3
|
-
import { ExecutionTarget } from './server.js';
|
|
4
|
-
import CommandTypes = tsp.CommandTypes;
|
|
5
|
-
export declare enum ServerType {
|
|
6
|
-
Syntax = "syntax",
|
|
7
|
-
Semantic = "semantic"
|
|
8
|
-
}
|
|
9
|
-
export declare namespace ServerResponse {
|
|
10
|
-
class Cancelled {
|
|
11
|
-
readonly reason: string;
|
|
12
|
-
readonly type = "cancelled";
|
|
13
|
-
constructor(reason: string);
|
|
14
|
-
}
|
|
15
|
-
const NoContent: {
|
|
16
|
-
readonly type: "noContent";
|
|
17
|
-
};
|
|
18
|
-
const NoServer: {
|
|
19
|
-
readonly type: "noServer";
|
|
20
|
-
};
|
|
21
|
-
type Response<T extends tsp.Response> = T | Cancelled | typeof NoContent | typeof NoServer;
|
|
22
|
-
}
|
|
23
|
-
export interface TypeScriptRequestTypes {
|
|
24
|
-
[CommandTypes.ApplyCodeActionCommand]: [tsp.ApplyCodeActionCommandRequestArgs, tsp.ApplyCodeActionCommandResponse];
|
|
25
|
-
[CommandTypes.Change]: [tsp.ChangeRequestArgs, null];
|
|
26
|
-
[CommandTypes.Close]: [tsp.FileRequestArgs, null];
|
|
27
|
-
[CommandTypes.CompilerOptionsForInferredProjects]: [tsp.SetCompilerOptionsForInferredProjectsArgs, tsp.SetCompilerOptionsForInferredProjectsResponse];
|
|
28
|
-
[CommandTypes.CompletionDetails]: [tsp.CompletionDetailsRequestArgs, tsp.CompletionDetailsResponse];
|
|
29
|
-
[CommandTypes.CompletionInfo]: [tsp.CompletionsRequestArgs, tsp.CompletionInfoResponse];
|
|
30
|
-
[CommandTypes.Configure]: [tsp.ConfigureRequestArguments, tsp.ConfigureResponse];
|
|
31
|
-
[CommandTypes.ConfigurePlugin]: [tsp.ConfigurePluginRequestArguments, tsp.ConfigurePluginResponse];
|
|
32
|
-
[CommandTypes.Definition]: [tsp.FileLocationRequestArgs, tsp.DefinitionResponse];
|
|
33
|
-
[CommandTypes.DefinitionAndBoundSpan]: [tsp.FileLocationRequestArgs, tsp.DefinitionInfoAndBoundSpanResponse];
|
|
34
|
-
[CommandTypes.DocCommentTemplate]: [tsp.FileLocationRequestArgs, tsp.DocCommandTemplateResponse];
|
|
35
|
-
[CommandTypes.DocumentHighlights]: [tsp.DocumentHighlightsRequestArgs, tsp.DocumentHighlightsResponse];
|
|
36
|
-
[CommandTypes.EncodedSemanticClassificationsFull]: [tsp.EncodedSemanticClassificationsRequestArgs, tsp.EncodedSemanticClassificationsResponse];
|
|
37
|
-
[CommandTypes.FindSourceDefinition]: [tsp.FileLocationRequestArgs, tsp.DefinitionResponse];
|
|
38
|
-
[CommandTypes.Format]: [tsp.FormatRequestArgs, tsp.FormatResponse];
|
|
39
|
-
[CommandTypes.Formatonkey]: [tsp.FormatOnKeyRequestArgs, tsp.FormatResponse];
|
|
40
|
-
[CommandTypes.GetApplicableRefactors]: [tsp.GetApplicableRefactorsRequestArgs, tsp.GetApplicableRefactorsResponse];
|
|
41
|
-
[CommandTypes.GetCodeFixes]: [tsp.CodeFixRequestArgs, tsp.CodeFixResponse];
|
|
42
|
-
[CommandTypes.GetCombinedCodeFix]: [tsp.GetCombinedCodeFixRequestArgs, tsp.GetCombinedCodeFixResponse];
|
|
43
|
-
[CommandTypes.GetEditsForFileRename]: [tsp.GetEditsForFileRenameRequestArgs, tsp.GetEditsForFileRenameResponse];
|
|
44
|
-
[CommandTypes.GetEditsForRefactor]: [tsp.GetEditsForRefactorRequestArgs, tsp.GetEditsForRefactorResponse];
|
|
45
|
-
[CommandTypes.Geterr]: [tsp.GeterrRequestArgs, any];
|
|
46
|
-
[CommandTypes.GetOutliningSpans]: [tsp.FileRequestArgs, tsp.OutliningSpansResponse];
|
|
47
|
-
[CommandTypes.GetSupportedCodeFixes]: [null, tsp.GetSupportedCodeFixesResponse];
|
|
48
|
-
[CommandTypes.Implementation]: [tsp.FileLocationRequestArgs, tsp.ImplementationResponse];
|
|
49
|
-
[CommandTypes.JsxClosingTag]: [tsp.JsxClosingTagRequestArgs, tsp.JsxClosingTagResponse];
|
|
50
|
-
[CommandTypes.Navto]: [tsp.NavtoRequestArgs, tsp.NavtoResponse];
|
|
51
|
-
[CommandTypes.NavTree]: [tsp.FileRequestArgs, tsp.NavTreeResponse];
|
|
52
|
-
[CommandTypes.Open]: [tsp.OpenRequestArgs, null];
|
|
53
|
-
[CommandTypes.OrganizeImports]: [tsp.OrganizeImportsRequestArgs, tsp.OrganizeImportsResponse];
|
|
54
|
-
[CommandTypes.PrepareCallHierarchy]: [tsp.FileLocationRequestArgs, tsp.PrepareCallHierarchyResponse];
|
|
55
|
-
[CommandTypes.ProvideCallHierarchyIncomingCalls]: [tsp.FileLocationRequestArgs, tsp.ProvideCallHierarchyIncomingCallsResponse];
|
|
56
|
-
[CommandTypes.ProvideCallHierarchyOutgoingCalls]: [tsp.FileLocationRequestArgs, tsp.ProvideCallHierarchyOutgoingCallsResponse];
|
|
57
|
-
[CommandTypes.ProjectInfo]: [tsp.ProjectInfoRequestArgs, tsp.ProjectInfoResponse];
|
|
58
|
-
[CommandTypes.ProvideInlayHints]: [tsp.InlayHintsRequestArgs, tsp.InlayHintsResponse];
|
|
59
|
-
[CommandTypes.Quickinfo]: [tsp.FileLocationRequestArgs, tsp.QuickInfoResponse];
|
|
60
|
-
[CommandTypes.References]: [tsp.FileLocationRequestArgs, tsp.ReferencesResponse];
|
|
61
|
-
[CommandTypes.Rename]: [tsp.RenameRequestArgs, tsp.RenameResponse];
|
|
62
|
-
[CommandTypes.SelectionRange]: [tsp.SelectionRangeRequestArgs, tsp.SelectionRangeResponse];
|
|
63
|
-
[CommandTypes.SignatureHelp]: [tsp.SignatureHelpRequestArgs, tsp.SignatureHelpResponse];
|
|
64
|
-
[CommandTypes.TypeDefinition]: [tsp.FileLocationRequestArgs, tsp.TypeDefinitionResponse];
|
|
65
|
-
[CommandTypes.UpdateOpen]: [tsp.UpdateOpenRequestArgs, tsp.Response];
|
|
66
|
-
}
|
|
67
|
-
export type ExecConfig = {
|
|
68
|
-
readonly lowPriority?: boolean;
|
|
69
|
-
readonly nonRecoverable?: boolean;
|
|
70
|
-
readonly cancelOnResourceChange?: vscodeUri.URI;
|
|
71
|
-
readonly executionTarget?: ExecutionTarget;
|
|
72
|
-
};
|
|
73
|
-
//# sourceMappingURL=requests.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"requests.d.ts","sourceRoot":"","sources":["../../src/tsServer/requests.ts"],"names":[],"mappings":"AAWA,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C,OAAO,YAAY,GAAG,GAAG,CAAC,YAAY,CAAC;AAEvC,oBAAY,UAAU;IAClB,MAAM,WAAW;IACjB,QAAQ,aAAa;CACxB;AAED,yBAAiB,cAAc,CAAC;IAE5B,MAAa,SAAS;iBAIE,MAAM,EAAE,MAAM;QAHlC,SAAgB,IAAI,eAAe;oBAGf,MAAM,EAAE,MAAM;KAErC;IAEM,MAAM,SAAS;;KAAiC,CAAC;IAEjD,MAAM,QAAQ;;KAAgC,CAAC;IAEtD,KAAY,QAAQ,CAAC,CAAC,SAAS,GAAG,CAAC,QAAQ,IAAI,CAAC,GAAG,SAAS,GAAG,OAAO,SAAS,GAAG,OAAO,QAAQ,CAAC;CACrG;AAED,MAAM,WAAW,sBAAsB;IACnC,CAAC,YAAY,CAAC,sBAAsB,CAAC,EAAE,CAAC,GAAG,CAAC,iCAAiC,EAAE,GAAG,CAAC,8BAA8B,CAAC,CAAC;IACnH,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,CAAC,GAAG,CAAC,iBA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G,CAAC,uBAAuB,EAAE,GAAG,CAAC,kBAAkB,CAAC,CAAC;IACjF,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,CAAC,GAAG,CAAC,iBAAiB,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;IACnE,CAAC,YAAY,CAAC,cAAc,CAAC,EAAE,CAAC,GAAG,CAAC,yBAAyB,EAAE,GAAG,CAAC,sBAAsB,CAAC,CAAC;IAC3F,CAAC,YAAY,CAAC,aAAa,CAAC,EAAE,CAAC,GAAG,CAAC,wBAAwB,EAAE,GAAG,CAAC,qBAAqB,CAAC,CAAC;IACxF,CAAC,YAAY,CAAC,cAAc,CAAC,EAAE,CAAC,GAAG,CAAC,uBAAuB,EAAE,GAAG,CAAC,sBAAsB,CAAC,CAAC;IACzF,CAAC,YAAY,CAAC,UAAU,CAAC,EAAE,CAAC,GAAG,CAAC,qBAAqB,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC;CACxE;AAED,MAAM,MAAM,UAAU,GAAG;IACrB,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IAC/B,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IAClC,QAAQ,CAAC,sBAAsB,CAAC,EAAE,SAAS,CAAC,GAAG,CAAC;IAChD,QAAQ,CAAC,eAAe,CAAC,EAAE,eAAe,CAAC;CAC9C,CAAC"}
|
package/lib/tsServer/requests.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
/*
|
|
6
|
-
* Copyright (C) 2022 TypeFox and others.
|
|
7
|
-
*
|
|
8
|
-
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
|
|
9
|
-
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*/
|
|
11
|
-
import { tsp } from '../ts-protocol.js';
|
|
12
|
-
var CommandTypes = tsp.CommandTypes;
|
|
13
|
-
export var ServerType;
|
|
14
|
-
(function (ServerType) {
|
|
15
|
-
ServerType["Syntax"] = "syntax";
|
|
16
|
-
ServerType["Semantic"] = "semantic";
|
|
17
|
-
})(ServerType = ServerType || (ServerType = {}));
|
|
18
|
-
export var ServerResponse;
|
|
19
|
-
(function (ServerResponse) {
|
|
20
|
-
class Cancelled {
|
|
21
|
-
constructor(reason) {
|
|
22
|
-
this.reason = reason;
|
|
23
|
-
this.type = 'cancelled';
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
ServerResponse.Cancelled = Cancelled;
|
|
27
|
-
ServerResponse.NoContent = { type: 'noContent' };
|
|
28
|
-
ServerResponse.NoServer = { type: 'noServer' };
|
|
29
|
-
})(ServerResponse = ServerResponse || (ServerResponse = {}));
|
|
30
|
-
//# sourceMappingURL=requests.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"requests.js","sourceRoot":"","sources":["../../src/tsServer/requests.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;;;;GAKG;AAGH,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGxC,IAAO,YAAY,GAAG,GAAG,CAAC,YAAY,CAAC;AAEvC,MAAM,CAAN,IAAY,UAGX;AAHD,WAAY,UAAU;IAClB,+BAAiB,CAAA;IACjB,mCAAqB,CAAA;AACzB,CAAC,EAHW,UAAU,GAAV,UAAU,KAAV,UAAU,QAGrB;AAED,MAAM,KAAW,cAAc,CAe9B;AAfD,WAAiB,cAAc;IAE3B,MAAa,SAAS;QAGlB,YACoB,MAAc;YAAd,WAAM,GAAN,MAAM,CAAQ;YAHlB,SAAI,GAAG,WAAW,CAAC;QAI/B,CAAC;KACR;IANY,wBAAS,YAMrB,CAAA;IAEY,wBAAS,GAAG,EAAE,IAAI,EAAE,WAAW,EAAW,CAAC;IAE3C,uBAAQ,GAAG,EAAE,IAAI,EAAE,UAAU,EAAW,CAAC;AAG1D,CAAC,EAfgB,cAAc,GAAd,cAAc,KAAd,cAAc,QAe9B"}
|
package/lib/tsServer/server.d.ts
DELETED
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
-
import { CancellationToken } from 'vscode-jsonrpc';
|
|
3
|
-
import { ServerResponse, ServerType, TypeScriptRequestTypes } from './requests.js';
|
|
4
|
-
import type { tsp } from '../ts-protocol.js';
|
|
5
|
-
import type { TspClientOptions } from '../tsp-client.js';
|
|
6
|
-
import { OngoingRequestCanceller } from './cancellation.js';
|
|
7
|
-
import type Tracer from './tracer.js';
|
|
8
|
-
import type { TypeScriptVersion } from './versionProvider.js';
|
|
9
|
-
export declare enum ExecutionTarget {
|
|
10
|
-
Semantic = 0,
|
|
11
|
-
Syntax = 1
|
|
12
|
-
}
|
|
13
|
-
export interface TypeScriptServerExitEvent {
|
|
14
|
-
readonly code: number | null;
|
|
15
|
-
readonly signal: NodeJS.Signals | null;
|
|
16
|
-
}
|
|
17
|
-
type OnEventHandler = (e: tsp.Event) => any;
|
|
18
|
-
type OnExitHandler = (e: TypeScriptServerExitEvent) => any;
|
|
19
|
-
type OnErrorHandler = (e: any) => any;
|
|
20
|
-
type OnStdErrHandler = (e: string) => any;
|
|
21
|
-
export interface ITypeScriptServer {
|
|
22
|
-
onEvent(handler: OnEventHandler): void;
|
|
23
|
-
onExit(handler: OnExitHandler): void;
|
|
24
|
-
onError(handler: OnErrorHandler): void;
|
|
25
|
-
onStdErr(handler: OnStdErrHandler): void;
|
|
26
|
-
readonly tsServerLogFile: string | undefined;
|
|
27
|
-
kill(): void;
|
|
28
|
-
/**
|
|
29
|
-
* @return A list of all execute requests. If there are multiple entries, the first item is the primary
|
|
30
|
-
* request while the rest are secondary ones.
|
|
31
|
-
*/
|
|
32
|
-
executeImpl(command: keyof TypeScriptRequestTypes, args: any, executeInfo: {
|
|
33
|
-
isAsync: boolean;
|
|
34
|
-
token?: CancellationToken;
|
|
35
|
-
expectsResult: boolean;
|
|
36
|
-
lowPriority?: boolean;
|
|
37
|
-
executionTarget?: ExecutionTarget;
|
|
38
|
-
}): Array<Promise<ServerResponse.Response<tsp.Response>> | undefined>;
|
|
39
|
-
dispose(): void;
|
|
40
|
-
}
|
|
41
|
-
export declare const enum TsServerProcessKind {
|
|
42
|
-
Main = "main",
|
|
43
|
-
Syntax = "syntax",
|
|
44
|
-
Semantic = "semantic",
|
|
45
|
-
Diagnostics = "diagnostics"
|
|
46
|
-
}
|
|
47
|
-
export interface TsServerProcessFactory {
|
|
48
|
-
fork(version: TypeScriptVersion, args: readonly string[], kind: TsServerProcessKind, configuration: TspClientOptions): TsServerProcess;
|
|
49
|
-
}
|
|
50
|
-
export interface TsServerProcess {
|
|
51
|
-
write(serverRequest: tsp.Request): void;
|
|
52
|
-
onData(handler: (data: tsp.Response) => void): void;
|
|
53
|
-
onExit(handler: (code: number | null, signal: NodeJS.Signals | null) => void): void;
|
|
54
|
-
onError(handler: (error: Error) => void): void;
|
|
55
|
-
onStdErr(handler: (code: string) => void): void;
|
|
56
|
-
kill(): void;
|
|
57
|
-
}
|
|
58
|
-
export declare class ProcessBasedTsServer implements ITypeScriptServer {
|
|
59
|
-
private readonly _serverId;
|
|
60
|
-
private readonly _serverSource;
|
|
61
|
-
private readonly _process;
|
|
62
|
-
private readonly _tsServerLogFile;
|
|
63
|
-
private readonly _requestCanceller;
|
|
64
|
-
private readonly _version;
|
|
65
|
-
private readonly _tracer;
|
|
66
|
-
private readonly _requestQueue;
|
|
67
|
-
private readonly _callbacks;
|
|
68
|
-
private readonly _pendingResponses;
|
|
69
|
-
private readonly _eventHandlers;
|
|
70
|
-
private readonly _exitHandlers;
|
|
71
|
-
private readonly _errorHandlers;
|
|
72
|
-
private readonly _stdErrHandlers;
|
|
73
|
-
constructor(_serverId: string, _serverSource: ServerType, _process: TsServerProcess, _tsServerLogFile: string | undefined, _requestCanceller: OngoingRequestCanceller, _version: TypeScriptVersion, _tracer: Tracer);
|
|
74
|
-
onEvent(handler: OnEventHandler): void;
|
|
75
|
-
onExit(handler: OnExitHandler): void;
|
|
76
|
-
onStdErr(handler: OnStdErrHandler): void;
|
|
77
|
-
onError(handler: OnErrorHandler): void;
|
|
78
|
-
get tsServerLogFile(): string | undefined;
|
|
79
|
-
private write;
|
|
80
|
-
dispose(): void;
|
|
81
|
-
kill(): void;
|
|
82
|
-
private dispatchMessage;
|
|
83
|
-
private tryCancelRequest;
|
|
84
|
-
private dispatchResponse;
|
|
85
|
-
executeImpl(command: keyof TypeScriptRequestTypes, args: any, executeInfo: {
|
|
86
|
-
isAsync: boolean;
|
|
87
|
-
token?: CancellationToken;
|
|
88
|
-
expectsResult: boolean;
|
|
89
|
-
lowPriority?: boolean;
|
|
90
|
-
executionTarget?: ExecutionTarget;
|
|
91
|
-
}): Array<Promise<ServerResponse.Response<tsp.Response>> | undefined>;
|
|
92
|
-
private sendNextRequests;
|
|
93
|
-
private sendRequest;
|
|
94
|
-
private fetchCallback;
|
|
95
|
-
private logTrace;
|
|
96
|
-
private static readonly fenceCommands;
|
|
97
|
-
private static getQueueingType;
|
|
98
|
-
}
|
|
99
|
-
export {};
|
|
100
|
-
//# sourceMappingURL=server.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/tsServer/server.ts"],"names":[],"mappings":";AAWA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AACnF,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAA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O,CAAC,cAAc,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,GAAG,SAAS,CAAC;IA2BxR,OAAO,CAAC,gBAAgB;IAUxB,OAAO,CAAC,WAAW;IAgBnB,OAAO,CAAC,aAAa;IAUrB,OAAO,CAAC,QAAQ;IAIhB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAsD;IAE3F,OAAO,CAAC,MAAM,CAAC,eAAe;CASjC"}
|
package/lib/tsServer/server.js
DELETED
|
@@ -1,216 +0,0 @@
|
|
|
1
|
-
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
/*
|
|
6
|
-
* Copyright (C) 2022 TypeFox and others.
|
|
7
|
-
*
|
|
8
|
-
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
|
|
9
|
-
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*/
|
|
11
|
-
import { RequestQueue, RequestQueueingType } from './requestQueue.js';
|
|
12
|
-
import { ServerResponse } from './requests.js';
|
|
13
|
-
import { CallbackMap } from './callbackMap.js';
|
|
14
|
-
import { TypeScriptServerError } from './serverError.js';
|
|
15
|
-
export var ExecutionTarget;
|
|
16
|
-
(function (ExecutionTarget) {
|
|
17
|
-
ExecutionTarget[ExecutionTarget["Semantic"] = 0] = "Semantic";
|
|
18
|
-
ExecutionTarget[ExecutionTarget["Syntax"] = 1] = "Syntax";
|
|
19
|
-
})(ExecutionTarget = ExecutionTarget || (ExecutionTarget = {}));
|
|
20
|
-
export class ProcessBasedTsServer {
|
|
21
|
-
constructor(_serverId, _serverSource, _process, _tsServerLogFile, _requestCanceller, _version, _tracer) {
|
|
22
|
-
this._serverId = _serverId;
|
|
23
|
-
this._serverSource = _serverSource;
|
|
24
|
-
this._process = _process;
|
|
25
|
-
this._tsServerLogFile = _tsServerLogFile;
|
|
26
|
-
this._requestCanceller = _requestCanceller;
|
|
27
|
-
this._version = _version;
|
|
28
|
-
this._tracer = _tracer;
|
|
29
|
-
this._requestQueue = new RequestQueue();
|
|
30
|
-
this._callbacks = new CallbackMap();
|
|
31
|
-
this._pendingResponses = new Set();
|
|
32
|
-
this._eventHandlers = new Set();
|
|
33
|
-
this._exitHandlers = new Set();
|
|
34
|
-
this._errorHandlers = new Set();
|
|
35
|
-
this._stdErrHandlers = new Set();
|
|
36
|
-
this._process.onData(msg => {
|
|
37
|
-
this.dispatchMessage(msg);
|
|
38
|
-
});
|
|
39
|
-
this._process.onStdErr(error => {
|
|
40
|
-
this._stdErrHandlers.forEach(handler => handler(error));
|
|
41
|
-
});
|
|
42
|
-
this._process.onExit((code, signal) => {
|
|
43
|
-
this._exitHandlers.forEach(handler => handler({ code, signal }));
|
|
44
|
-
this._callbacks.destroy('server exited');
|
|
45
|
-
});
|
|
46
|
-
this._process.onError(error => {
|
|
47
|
-
this._errorHandlers.forEach(handler => handler(error));
|
|
48
|
-
this._callbacks.destroy('server errored');
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
onEvent(handler) {
|
|
52
|
-
this._eventHandlers.add(handler);
|
|
53
|
-
}
|
|
54
|
-
onExit(handler) {
|
|
55
|
-
this._exitHandlers.add(handler);
|
|
56
|
-
}
|
|
57
|
-
onStdErr(handler) {
|
|
58
|
-
this._stdErrHandlers.add(handler);
|
|
59
|
-
}
|
|
60
|
-
onError(handler) {
|
|
61
|
-
this._errorHandlers.add(handler);
|
|
62
|
-
}
|
|
63
|
-
get tsServerLogFile() {
|
|
64
|
-
return this._tsServerLogFile;
|
|
65
|
-
}
|
|
66
|
-
write(serverRequest) {
|
|
67
|
-
this._process.write(serverRequest);
|
|
68
|
-
}
|
|
69
|
-
dispose() {
|
|
70
|
-
this._callbacks.destroy('server disposed');
|
|
71
|
-
this._pendingResponses.clear();
|
|
72
|
-
this._eventHandlers.clear();
|
|
73
|
-
this._exitHandlers.clear();
|
|
74
|
-
this._errorHandlers.clear();
|
|
75
|
-
}
|
|
76
|
-
kill() {
|
|
77
|
-
this.dispose();
|
|
78
|
-
this._process.kill();
|
|
79
|
-
}
|
|
80
|
-
dispatchMessage(message) {
|
|
81
|
-
try {
|
|
82
|
-
switch (message.type) {
|
|
83
|
-
case 'response':
|
|
84
|
-
if (this._serverSource) {
|
|
85
|
-
this.dispatchResponse({
|
|
86
|
-
...message,
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
else {
|
|
90
|
-
this.dispatchResponse(message);
|
|
91
|
-
}
|
|
92
|
-
break;
|
|
93
|
-
case 'event': {
|
|
94
|
-
const event = message;
|
|
95
|
-
if (event.event === 'requestCompleted') {
|
|
96
|
-
const seq = event.body.request_seq;
|
|
97
|
-
const callback = this._callbacks.fetch(seq);
|
|
98
|
-
if (callback) {
|
|
99
|
-
this._tracer.traceRequestCompleted(this._serverId, 'requestCompleted', seq, callback);
|
|
100
|
-
callback.onSuccess(undefined);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
else {
|
|
104
|
-
this._tracer.traceEvent(this._serverId, event);
|
|
105
|
-
this._eventHandlers.forEach(handler => handler(event));
|
|
106
|
-
}
|
|
107
|
-
break;
|
|
108
|
-
}
|
|
109
|
-
default:
|
|
110
|
-
throw new Error(`Unknown message type ${message.type} received`);
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
finally {
|
|
114
|
-
this.sendNextRequests();
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
tryCancelRequest(seq, command) {
|
|
118
|
-
try {
|
|
119
|
-
if (this._requestQueue.tryDeletePendingRequest(seq)) {
|
|
120
|
-
this.logTrace(`Canceled request with sequence number ${seq}`);
|
|
121
|
-
return true;
|
|
122
|
-
}
|
|
123
|
-
if (this._requestCanceller.tryCancelOngoingRequest(seq)) {
|
|
124
|
-
return true;
|
|
125
|
-
}
|
|
126
|
-
this.logTrace(`Tried to cancel request with sequence number ${seq}. But request got already delivered.`);
|
|
127
|
-
return false;
|
|
128
|
-
}
|
|
129
|
-
finally {
|
|
130
|
-
const callback = this.fetchCallback(seq);
|
|
131
|
-
callback?.onSuccess(new ServerResponse.Cancelled(`Cancelled request ${seq} - ${command}`));
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
dispatchResponse(response) {
|
|
135
|
-
const callback = this.fetchCallback(response.request_seq);
|
|
136
|
-
if (!callback) {
|
|
137
|
-
return;
|
|
138
|
-
}
|
|
139
|
-
this._tracer.traceResponse(this._serverId, response, callback);
|
|
140
|
-
if (response.success) {
|
|
141
|
-
callback.onSuccess(response);
|
|
142
|
-
}
|
|
143
|
-
else if (response.message === 'No content available.') {
|
|
144
|
-
// Special case where response itself is successful but there is not any data to return.
|
|
145
|
-
callback.onSuccess(ServerResponse.NoContent);
|
|
146
|
-
}
|
|
147
|
-
else {
|
|
148
|
-
callback.onError(TypeScriptServerError.create(this._serverId, this._version, response));
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
executeImpl(command, args, executeInfo) {
|
|
152
|
-
const request = this._requestQueue.createRequest(command, args);
|
|
153
|
-
const requestInfo = {
|
|
154
|
-
request,
|
|
155
|
-
expectsResponse: executeInfo.expectsResult,
|
|
156
|
-
isAsync: executeInfo.isAsync,
|
|
157
|
-
queueingType: ProcessBasedTsServer.getQueueingType(command, executeInfo.lowPriority),
|
|
158
|
-
};
|
|
159
|
-
let result;
|
|
160
|
-
if (executeInfo.expectsResult) {
|
|
161
|
-
result = new Promise((resolve, reject) => {
|
|
162
|
-
this._callbacks.add(request.seq, { onSuccess: resolve, onError: reject, queuingStartTime: Date.now(), isAsync: executeInfo.isAsync }, executeInfo.isAsync);
|
|
163
|
-
if (executeInfo.token) {
|
|
164
|
-
executeInfo.token.onCancellationRequested(() => {
|
|
165
|
-
this.tryCancelRequest(request.seq, command);
|
|
166
|
-
});
|
|
167
|
-
}
|
|
168
|
-
});
|
|
169
|
-
}
|
|
170
|
-
this._requestQueue.enqueue(requestInfo);
|
|
171
|
-
this.sendNextRequests();
|
|
172
|
-
return [result];
|
|
173
|
-
}
|
|
174
|
-
sendNextRequests() {
|
|
175
|
-
// console.error({ pending: this._pendingResponses.size, queue: this._requestQueue.length });
|
|
176
|
-
while (this._pendingResponses.size === 0 && this._requestQueue.length > 0) {
|
|
177
|
-
const item = this._requestQueue.dequeue();
|
|
178
|
-
if (item) {
|
|
179
|
-
this.sendRequest(item);
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
sendRequest(requestItem) {
|
|
184
|
-
const serverRequest = requestItem.request;
|
|
185
|
-
this._tracer.traceRequest(this._serverId, serverRequest, requestItem.expectsResponse, this._requestQueue.length);
|
|
186
|
-
if (requestItem.expectsResponse && !requestItem.isAsync) {
|
|
187
|
-
this._pendingResponses.add(requestItem.request.seq);
|
|
188
|
-
}
|
|
189
|
-
try {
|
|
190
|
-
this.write(serverRequest);
|
|
191
|
-
}
|
|
192
|
-
catch (err) {
|
|
193
|
-
const callback = this.fetchCallback(serverRequest.seq);
|
|
194
|
-
callback?.onError(err);
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
fetchCallback(seq) {
|
|
198
|
-
const callback = this._callbacks.fetch(seq);
|
|
199
|
-
if (!callback) {
|
|
200
|
-
return undefined;
|
|
201
|
-
}
|
|
202
|
-
this._pendingResponses.delete(seq);
|
|
203
|
-
return callback;
|
|
204
|
-
}
|
|
205
|
-
logTrace(message) {
|
|
206
|
-
this._tracer.logTrace(this._serverId, message);
|
|
207
|
-
}
|
|
208
|
-
static getQueueingType(command, lowPriority) {
|
|
209
|
-
if (ProcessBasedTsServer.fenceCommands.has(command)) {
|
|
210
|
-
return RequestQueueingType.Fence;
|
|
211
|
-
}
|
|
212
|
-
return lowPriority ? RequestQueueingType.LowPriority : RequestQueueingType.Normal;
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
ProcessBasedTsServer.fenceCommands = new Set(['change', 'close', 'open', 'updateOpen']);
|
|
216
|
-
//# sourceMappingURL=server.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/tsServer/server.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;;;;GAKG;AAGH,OAAO,EAAe,YAAY,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACnF,OAAO,EAAE,cAAc,EAAsC,MAAM,eAAe,CAAC;AAInF,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAIzD,MAAM,CAAN,IAAY,eAGX;AAHD,WAAY,eAAe;IACvB,6DAAQ,CAAA;IACR,yDAAM,CAAA;AACV,CAAC,EAHW,eAAe,GAAf,eAAe,KAAf,eAAe,QAG1B;AA0DD,MAAM,OAAO,oBAAoB;IAS7B,YACqB,SAAiB,EACjB,aAAyB,EACzB,QAAyB,EACzB,gBAAoC,EACpC,iBAA0C,EAC1C,QAA2B,EAC3B,OAAe;QANf,cAAS,GAAT,SAAS,CAAQ;QACjB,kBAAa,GAAb,aAAa,CAAY;QACzB,aAAQ,GAAR,QAAQ,CAAiB;QACzB,qBAAgB,GAAhB,gBAAgB,CAAoB;QACpC,sBAAiB,GAAjB,iBAAiB,CAAyB;QAC1C,aAAQ,GAAR,QAAQ,CAAmB;QAC3B,YAAO,GAAP,OAAO,CAAQ;QAfnB,kBAAa,GAAG,IAAI,YAAY,EAAE,CAAC;QACnC,eAAU,GAAG,IAAI,WAAW,EAAgB,CAAC;QAC7C,sBAAiB,GAAG,IAAI,GAAG,EAAU,CAAC;QACtC,mBAAc,GAAG,IAAI,GAAG,EAAkB,CAAC;QAC3C,kBAAa,GAAG,IAAI,GAAG,EAAiB,CAAC;QACzC,mBAAc,GAAG,IAAI,GAAG,EAAkB,CAAC;QAC3C,oB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,aAAa,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;YACvD,QAAQ,EAAE,OAAO,CAAC,GAAY,CAAC,CAAC;SACnC;IACL,CAAC;IAEO,aAAa,CAAC,GAAW;QAC7B,MAAM,QAAQ,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC5C,IAAI,CAAC,QAAQ,EAAE;YACX,OAAO,SAAS,CAAC;SACpB;QAED,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACnC,OAAO,QAAQ,CAAC;IACpB,CAAC;IAEO,QAAQ,CAAC,OAAe;QAC5B,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IACnD,CAAC;IAIO,MAAM,CAAC,eAAe,CAC1B,OAAe,EACf,WAAqB;QAErB,IAAI,oBAAoB,CAAC,aAAa,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE;YACjD,OAAO,mBAAmB,CAAC,KAAK,CAAC;SACpC;QACD,OAAO,WAAW,CAAC,CAAC,CAAC,mBAAmB,CAAC,WAAW,CAAC,CAAC,CAAC,mBAAmB,CAAC,MAAM,CAAC;IACtF,CAAC;;AAVuB,kCAAa,GAAG,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { tsp } from '../ts-protocol.js';
|
|
2
|
-
import type { TypeScriptVersion } from './versionProvider.js';
|
|
3
|
-
export declare class TypeScriptServerError extends Error {
|
|
4
|
-
readonly serverId: string;
|
|
5
|
-
readonly version: TypeScriptVersion;
|
|
6
|
-
private readonly response;
|
|
7
|
-
readonly serverMessage: string | undefined;
|
|
8
|
-
readonly serverStack: string | undefined;
|
|
9
|
-
static create(serverId: string, version: TypeScriptVersion, response: tsp.Response): TypeScriptServerError;
|
|
10
|
-
private constructor();
|
|
11
|
-
get serverErrorText(): string | undefined;
|
|
12
|
-
get serverCommand(): string;
|
|
13
|
-
/**
|
|
14
|
-
* Given a `errorText` from a tsserver request indicating failure in handling a request.
|
|
15
|
-
*/
|
|
16
|
-
private static parseErrorText;
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=serverError.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"serverError.d.ts","sourceRoot":"","sources":["../../src/tsServer/serverError.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE9D,qBAAa,qBAAsB,SAAQ,KAAK;aAWxB,QAAQ,EAAE,MAAM;aAChB,OAAO,EAAE,iBAAiB;IAC1C,OAAO,CAAC,QAAQ,CAAC,QAAQ;aACT,aAAa,EAAE,MAAM,GAAG,SAAS;aACjC,WAAW,EAAE,MAAM,GAAG,SAAS;WAdrC,MAAM,CAChB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,iBAAiB,EAC1B,QAAQ,EAAE,GAAG,CAAC,QAAQ,GACvB,qBAAqB;IAKxB,OAAO;IAUP,IAAW,eAAe,IAAI,MAAM,GAAG,SAAS,CAE/C;IAED,IAAW,aAAa,IAAI,MAAM,CAEjC;IAED;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,cAAc;CAmBhC"}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
/*
|
|
6
|
-
* Copyright (C) 2022 TypeFox and others.
|
|
7
|
-
*
|
|
8
|
-
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
|
|
9
|
-
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*/
|
|
11
|
-
export class TypeScriptServerError extends Error {
|
|
12
|
-
static create(serverId, version, response) {
|
|
13
|
-
const parsedResult = TypeScriptServerError.parseErrorText(response);
|
|
14
|
-
return new TypeScriptServerError(serverId, version, response, parsedResult?.message, parsedResult?.stack);
|
|
15
|
-
}
|
|
16
|
-
constructor(serverId, version, response, serverMessage, serverStack) {
|
|
17
|
-
super(`<${serverId}> TypeScript Server Error (${version.versionString})\n${serverMessage}\n${serverStack}`);
|
|
18
|
-
this.serverId = serverId;
|
|
19
|
-
this.version = version;
|
|
20
|
-
this.response = response;
|
|
21
|
-
this.serverMessage = serverMessage;
|
|
22
|
-
this.serverStack = serverStack;
|
|
23
|
-
}
|
|
24
|
-
get serverErrorText() {
|
|
25
|
-
return this.response.message;
|
|
26
|
-
}
|
|
27
|
-
get serverCommand() {
|
|
28
|
-
return this.response.command;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Given a `errorText` from a tsserver request indicating failure in handling a request.
|
|
32
|
-
*/
|
|
33
|
-
static parseErrorText(response) {
|
|
34
|
-
const errorText = response.message;
|
|
35
|
-
if (errorText) {
|
|
36
|
-
const errorPrefix = 'Error processing request. ';
|
|
37
|
-
if (errorText.startsWith(errorPrefix)) {
|
|
38
|
-
const prefixFreeErrorText = errorText.substr(errorPrefix.length);
|
|
39
|
-
const newlineIndex = prefixFreeErrorText.indexOf('\n');
|
|
40
|
-
if (newlineIndex >= 0) {
|
|
41
|
-
// Newline expected between message and stack.
|
|
42
|
-
const stack = prefixFreeErrorText.substring(newlineIndex + 1);
|
|
43
|
-
return {
|
|
44
|
-
message: prefixFreeErrorText.substring(0, newlineIndex),
|
|
45
|
-
stack,
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
return undefined;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
//# s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AM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;gBACjE,MAAM,YAAY,GAAG,mBAAmB,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;gBACvD,IAAI,YAAY,IAAI,CAAC,EAAE;oBACnB,8CAA8C;oBAC9C,MAAM,KAAK,GAAG,mBAAmB,CAAC,SAAS,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC;oBAC9D,OAAO;wBACH,OAAO,EAAE,mBAAmB,CAAC,SAAS,CAAC,CAAC,EAAE,YAAY,CAAC;wBACvD,KAAK;qBACR,CAAC;iBACL;aACJ;SACJ;QACD,OAAO,SAAS,CAAC;IACrB,CAAC;CACJ"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { TsServerProcess, TsServerProcessFactory, TsServerProcessKind } from './server.js';
|
|
2
|
-
import type { TspClientOptions } from '../tsp-client.js';
|
|
3
|
-
import type { TypeScriptVersion } from './versionProvider.js';
|
|
4
|
-
export declare class NodeTsServerProcessFactory implements TsServerProcessFactory {
|
|
5
|
-
fork(version: TypeScriptVersion, args: readonly string[], kind: TsServerProcessKind, configuration: TspClientOptions): TsServerProcess;
|
|
6
|
-
}
|
|
7
|
-
//# sourceMappingURL=serverProcess.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"serverProcess.d.ts","sourceRoot":"","sources":["../../src/tsServer/serverProcess.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAE3F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE9D,qBAAa,0BAA2B,YAAW,sBAAsB;IACrE,IAAI,CACA,OAAO,EAAE,iBAAiB,EAC1B,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,IAAI,EAAE,mBAAmB,EACzB,aAAa,EAAE,gBAAgB,GAChC,eAAe;CAmBrB"}
|