typescript-language-server 1.1.2 → 2.0.0
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 +35 -0
- package/LICENSE +39 -0
- package/README.md +43 -2
- package/lib/cli.js +6 -6
- package/lib/cli.js.map +1 -1
- package/lib/completion.d.ts +1 -2
- package/lib/completion.d.ts.map +1 -1
- package/lib/completion.js +38 -19
- package/lib/completion.js.map +1 -1
- package/lib/configuration-manager.d.ts +3 -10
- package/lib/configuration-manager.d.ts.map +1 -1
- package/lib/configuration-manager.js +24 -4
- package/lib/configuration-manager.js.map +1 -1
- package/lib/diagnostic-queue.d.ts +1 -1
- package/lib/diagnostic-queue.d.ts.map +1 -1
- package/lib/features/inlay-hints.js +2 -2
- package/lib/features/inlay-hints.js.map +1 -1
- package/lib/lsp-connection.d.ts +5 -5
- package/lib/lsp-connection.d.ts.map +1 -1
- package/lib/lsp-connection.js +2 -3
- package/lib/lsp-connection.js.map +1 -1
- package/lib/lsp-server.d.ts +7 -10
- package/lib/lsp-server.d.ts.map +1 -1
- package/lib/lsp-server.js +61 -115
- package/lib/lsp-server.js.map +1 -1
- package/lib/lsp-server.spec.js +382 -81
- package/lib/lsp-server.spec.js.map +1 -1
- package/lib/refactor.d.ts +2 -1
- package/lib/refactor.d.ts.map +1 -1
- package/lib/refactor.js +17 -7
- package/lib/refactor.js.map +1 -1
- package/lib/test-utils.d.ts +18 -0
- package/lib/test-utils.d.ts.map +1 -1
- package/lib/test-utils.js +24 -12
- package/lib/test-utils.js.map +1 -1
- package/lib/ts-protocol.d.ts +30 -8
- package/lib/ts-protocol.d.ts.map +1 -1
- package/lib/ts-protocol.js +7 -1
- package/lib/ts-protocol.js.map +1 -1
- package/lib/tsServer/callbackMap.d.ts +17 -0
- package/lib/tsServer/callbackMap.d.ts.map +1 -0
- package/lib/tsServer/callbackMap.js +47 -0
- package/lib/tsServer/callbackMap.js.map +1 -0
- package/lib/tsServer/cancellation.d.ts +22 -0
- package/lib/tsServer/cancellation.d.ts.map +1 -0
- package/lib/tsServer/cancellation.js +51 -0
- package/lib/tsServer/cancellation.js.map +1 -0
- package/lib/tsServer/logDirectoryProvider.d.ts +13 -0
- package/lib/tsServer/logDirectoryProvider.d.ts.map +1 -0
- package/lib/tsServer/logDirectoryProvider.js +49 -0
- package/lib/tsServer/logDirectoryProvider.js.map +1 -0
- package/lib/tsServer/requestQueue.d.ts +34 -0
- package/lib/tsServer/requestQueue.d.ts.map +1 -0
- package/lib/tsServer/requestQueue.js +74 -0
- package/lib/tsServer/requestQueue.js.map +1 -0
- package/lib/tsServer/requests.d.ts +68 -0
- package/lib/tsServer/requests.d.ts.map +1 -0
- package/lib/tsServer/requests.js +28 -0
- package/lib/tsServer/requests.js.map +1 -0
- package/lib/tsServer/server.d.ts +95 -0
- package/lib/tsServer/server.d.ts.map +1 -0
- package/lib/tsServer/server.js +209 -0
- package/lib/tsServer/server.js.map +1 -0
- package/lib/tsServer/serverError.d.ts +18 -0
- package/lib/tsServer/serverError.d.ts.map +1 -0
- package/lib/tsServer/serverError.js +53 -0
- package/lib/tsServer/serverError.js.map +1 -0
- package/lib/tsServer/serverProcess.d.ts +7 -0
- package/lib/tsServer/serverProcess.d.ts.map +1 -0
- package/lib/tsServer/serverProcess.js +238 -0
- package/lib/tsServer/serverProcess.js.map +1 -0
- package/lib/tsServer/spawner.d.ts +19 -0
- package/lib/tsServer/spawner.d.ts.map +1 -0
- package/lib/tsServer/spawner.js +130 -0
- package/lib/tsServer/spawner.js.map +1 -0
- package/lib/tsServer/tracer.d.ts +26 -0
- package/lib/tsServer/tracer.d.ts.map +1 -0
- package/lib/tsServer/tracer.js +80 -0
- package/lib/tsServer/tracer.js.map +1 -0
- package/lib/{utils → tsServer}/versionProvider.d.ts +8 -8
- package/lib/tsServer/versionProvider.d.ts.map +1 -0
- package/lib/{utils → tsServer}/versionProvider.js +28 -22
- package/lib/tsServer/versionProvider.js.map +1 -0
- package/lib/tsp-client.d.ts +25 -55
- package/lib/tsp-client.d.ts.map +1 -1
- package/lib/tsp-client.js +186 -140
- package/lib/tsp-client.js.map +1 -1
- package/lib/tsp-client.spec.js +23 -8
- package/lib/tsp-client.spec.js.map +1 -1
- package/lib/utils/api.d.ts +1 -0
- package/lib/utils/api.d.ts.map +1 -1
- package/lib/utils/api.js +1 -0
- package/lib/utils/api.js.map +1 -1
- package/lib/utils/configuration.d.ts +17 -8
- package/lib/utils/configuration.d.ts.map +1 -1
- package/lib/utils/configuration.js +43 -1
- package/lib/utils/configuration.js.map +1 -1
- package/lib/utils/logger.d.ts +65 -0
- package/lib/utils/logger.d.ts.map +1 -0
- package/lib/utils/logger.js +189 -0
- package/lib/utils/logger.js.map +1 -0
- package/lib/utils/modules-resolver.spec.js +1 -1
- package/lib/utils/modules-resolver.spec.js.map +1 -1
- package/package.json +12 -12
- package/lib/logger.d.ts +0 -48
- package/lib/logger.d.ts.map +0 -1
- package/lib/logger.js +0 -106
- package/lib/logger.js.map +0 -1
- package/lib/utils/versionProvider.d.ts.map +0 -1
- package/lib/utils/versionProvider.js.map +0 -1
|
@@ -0,0 +1,130 @@
|
|
|
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) 2017, 2018 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 path from 'node:path';
|
|
12
|
+
import API from '../utils/api.js';
|
|
13
|
+
import { ServerType } from './requests.js';
|
|
14
|
+
import { LogLevel } from '../utils/logger.js';
|
|
15
|
+
import { nodeRequestCancellerFactory } from './cancellation.js';
|
|
16
|
+
import { ProcessBasedTsServer } from './server.js';
|
|
17
|
+
import { NodeTsServerProcessFactory } from './serverProcess.js';
|
|
18
|
+
import { TsServerLogLevel } from '../utils/configuration.js';
|
|
19
|
+
export class TypeScriptServerSpawner {
|
|
20
|
+
constructor(_apiVersion, _logDirectoryProvider, _logger, _tracer) {
|
|
21
|
+
this._apiVersion = _apiVersion;
|
|
22
|
+
this._logDirectoryProvider = _logDirectoryProvider;
|
|
23
|
+
this._logger = _logger;
|
|
24
|
+
this._tracer = _tracer;
|
|
25
|
+
}
|
|
26
|
+
spawn(version, configuration) {
|
|
27
|
+
const kind = "main" /* TsServerProcessKind.Main */;
|
|
28
|
+
const processFactory = new NodeTsServerProcessFactory();
|
|
29
|
+
const canceller = nodeRequestCancellerFactory.create(kind, this._tracer);
|
|
30
|
+
const { args, tsServerLogFile } = this.getTsServerArgs("main" /* TsServerProcessKind.Main */, configuration, this._apiVersion, canceller.cancellationPipeName);
|
|
31
|
+
if (this.isLoggingEnabled(configuration)) {
|
|
32
|
+
if (tsServerLogFile) {
|
|
33
|
+
this._logger.logIgnoringVerbosity(LogLevel.Info, `<${kind}> Log file: ${tsServerLogFile}`);
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
this._logger.logIgnoringVerbosity(LogLevel.Error, `<${kind}> Could not create log directory`);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
const process = processFactory.fork(version, args, "main" /* TsServerProcessKind.Main */, configuration);
|
|
40
|
+
this._logger.log('Starting tsserver');
|
|
41
|
+
return new ProcessBasedTsServer(kind, this.kindToServerType(kind), process, tsServerLogFile, canceller, version, this._tracer);
|
|
42
|
+
}
|
|
43
|
+
kindToServerType(kind) {
|
|
44
|
+
switch (kind) {
|
|
45
|
+
case "syntax" /* TsServerProcessKind.Syntax */:
|
|
46
|
+
return ServerType.Syntax;
|
|
47
|
+
case "main" /* TsServerProcessKind.Main */:
|
|
48
|
+
case "semantic" /* TsServerProcessKind.Semantic */:
|
|
49
|
+
case "diagnostics" /* TsServerProcessKind.Diagnostics */:
|
|
50
|
+
default:
|
|
51
|
+
return ServerType.Semantic;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
getTsServerArgs(kind, configuration,
|
|
55
|
+
// currentVersion: TypeScriptVersion,
|
|
56
|
+
apiVersion, cancellationPipeName) {
|
|
57
|
+
const args = [];
|
|
58
|
+
let tsServerLogFile;
|
|
59
|
+
let tsServerTraceDirectory;
|
|
60
|
+
if (kind === "syntax" /* TsServerProcessKind.Syntax */) {
|
|
61
|
+
if (apiVersion.gte(API.v401)) {
|
|
62
|
+
args.push('--serverMode', 'partialSemantic');
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
args.push('--syntaxOnly');
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
if (apiVersion.gte(API.v250)) {
|
|
69
|
+
args.push('--useInferredProjectPerProjectRoot');
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
args.push('--useSingleInferredProject');
|
|
73
|
+
}
|
|
74
|
+
const { disableAutomaticTypingAcquisition, globalPlugins, locale, npmLocation, pluginProbeLocations } = configuration;
|
|
75
|
+
if (disableAutomaticTypingAcquisition || kind === "syntax" /* TsServerProcessKind.Syntax */ || kind === "diagnostics" /* TsServerProcessKind.Diagnostics */) {
|
|
76
|
+
args.push('--disableAutomaticTypingAcquisition');
|
|
77
|
+
}
|
|
78
|
+
// if (kind === TsServerProcessKind.Semantic || kind === TsServerProcessKind.Main) {
|
|
79
|
+
// args.push('--enableTelemetry');
|
|
80
|
+
// }
|
|
81
|
+
if (cancellationPipeName) {
|
|
82
|
+
args.push('--cancellationPipeName', cancellationPipeName + '*');
|
|
83
|
+
}
|
|
84
|
+
if (this.isLoggingEnabled(configuration)) {
|
|
85
|
+
const logDir = this._logDirectoryProvider.getNewLogDirectory();
|
|
86
|
+
if (logDir) {
|
|
87
|
+
tsServerLogFile = path.join(logDir, 'tsserver.log');
|
|
88
|
+
args.push('--logVerbosity', TsServerLogLevel.toString(configuration.logVerbosity));
|
|
89
|
+
args.push('--logFile', tsServerLogFile);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
// if (configuration.enableTsServerTracing) {
|
|
93
|
+
// tsServerTraceDirectory = this._logDirectoryProvider.getNewLogDirectory();
|
|
94
|
+
// if (tsServerTraceDirectory) {
|
|
95
|
+
// args.push('--traceDirectory', tsServerTraceDirectory);
|
|
96
|
+
// }
|
|
97
|
+
// }
|
|
98
|
+
// const pluginPaths = this._pluginPathsProvider.getPluginPaths();
|
|
99
|
+
// if (pluginManager.plugins.length) {
|
|
100
|
+
// args.push('--globalPlugins', pluginManager.plugins.map(x => x.name).join(','));
|
|
101
|
+
// const isUsingBundledTypeScriptVersion = currentVersion.path === this._versionProvider.defaultVersion.path;
|
|
102
|
+
// for (const plugin of pluginManager.plugins) {
|
|
103
|
+
// if (isUsingBundledTypeScriptVersion || plugin.enableForWorkspaceTypeScriptVersions) {
|
|
104
|
+
// pluginPaths.push(isWeb() ? plugin.uri.toString() : plugin.uri.fsPath);
|
|
105
|
+
// }
|
|
106
|
+
// }
|
|
107
|
+
// }
|
|
108
|
+
// if (pluginPaths.length !== 0) {
|
|
109
|
+
// args.push('--pluginProbeLocations', pluginPaths.join(','));
|
|
110
|
+
// }
|
|
111
|
+
if (globalPlugins && globalPlugins.length) {
|
|
112
|
+
args.push('--globalPlugins', globalPlugins.join(','));
|
|
113
|
+
}
|
|
114
|
+
if (pluginProbeLocations && pluginProbeLocations.length) {
|
|
115
|
+
args.push('--pluginProbeLocations', pluginProbeLocations.join(','));
|
|
116
|
+
}
|
|
117
|
+
if (npmLocation) {
|
|
118
|
+
this._logger.info(`using npm from ${npmLocation}`);
|
|
119
|
+
args.push('--npmLocation', `"${npmLocation}"`);
|
|
120
|
+
}
|
|
121
|
+
args.push('--locale', locale || 'en');
|
|
122
|
+
// args.push('--noGetErrOnBackgroundUpdate');
|
|
123
|
+
args.push('--validateDefaultNpmLocation');
|
|
124
|
+
return { args, tsServerLogFile, tsServerTraceDirectory };
|
|
125
|
+
}
|
|
126
|
+
isLoggingEnabled(configuration) {
|
|
127
|
+
return configuration.logVerbosity !== TsServerLogLevel.Off;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
//# sourceMappingURL=spawner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spawner.js","sourceRoot":"","sources":["../../src/tsServer/spawner.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;;;;GAKG;AAEH,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,GAAG,MAAM,iBAAiB,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAU,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAEhE,OAAO,EAAqB,oBAAoB,EAAuB,MAAM,aAAa,CAAC;AAC3F,OAAO,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAGhE,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE7D,MAAM,OAAO,uBAAuB;IAChC,YACqB,WAAgB,EAChB,qBAA4C,EAC5C,OAAe,EACf,OAAe;QAHf,gBAAW,GAAX,WAAW,CAAK;QAChB,0BAAqB,GAArB,qBAAqB,CAAuB;QAC5C,YAAO,GAAP,OAAO,CAAQ;QACf,YAAO,GAAP,OAAO,CAAQ;IAChC,CAAC;IAEE,KAAK,CACR,OAA0B,EAC1B,aAA+B;QAE/B,MAAM,IAAI,wCAA2B,CAAC;QACtC,MAAM,cAAc,GAAG,IAAI,0BAA0B,EAAE,CAAC;QACxD,MAAM,SAAS,GAAG,2BAA2B,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QACzE,MAAM,EAAE,IAAI,EAAE,eAAe,EAAE,GAAG,IAAI,C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oDAAoD;QACpD,gGAAgG;QAChG,qFAAqF;QACrF,YAAY;QACZ,QAAQ;QACR,IAAI;QACJ,kCAAkC;QAClC,kEAAkE;QAClE,IAAI;QACJ,IAAI,aAAa,IAAI,aAAa,CAAC,MAAM,EAAE;YACvC,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,aAAa,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;SACzD;QACD,IAAI,oBAAoB,IAAI,oBAAoB,CAAC,MAAM,EAAE;YACrD,IAAI,CAAC,IAAI,CAAC,wBAAwB,EAAE,oBAAoB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;SACvE;QACD,IAAI,WAAW,EAAE;YACb,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,kBAAkB,WAAW,EAAE,CAAC,CAAC;YACnD,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,IAAI,WAAW,GAAG,CAAC,CAAC;SAClD;QACD,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,MAAM,IAAI,IAAI,CAAC,CAAC;QACtC,6CAA6C;QAC7C,IAAI,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC;QAC1C,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,sBAAsB,EAAE,CAAC;IAC7D,CAAC;IAEO,gBAAgB,CAAC,aAA+B;QACpD,OAAO,aAAa,CAAC,YAAY,KAAK,gBAAgB,CAAC,GAAG,CAAC;IAC/D,CAAC;CACJ"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type tsp from 'typescript/lib/protocol.d.js';
|
|
2
|
+
import { Logger } from '../utils/logger.js';
|
|
3
|
+
export declare enum Trace {
|
|
4
|
+
Off = 0,
|
|
5
|
+
Messages = 1,
|
|
6
|
+
Verbose = 2
|
|
7
|
+
}
|
|
8
|
+
export declare type TraceValue = 'off' | 'messages' | 'verbose';
|
|
9
|
+
export declare namespace Trace {
|
|
10
|
+
function fromString(value: string): Trace;
|
|
11
|
+
}
|
|
12
|
+
interface RequestExecutionMetadata {
|
|
13
|
+
readonly queuingStartTime: number;
|
|
14
|
+
}
|
|
15
|
+
export default class Tracer {
|
|
16
|
+
private readonly logger;
|
|
17
|
+
private readonly trace;
|
|
18
|
+
constructor(logger: Logger, trace: Trace);
|
|
19
|
+
traceRequest(serverId: string, request: tsp.Request, responseExpected: boolean, queueLength: number): void;
|
|
20
|
+
traceResponse(serverId: string, response: tsp.Response, meta: RequestExecutionMetadata): void;
|
|
21
|
+
traceRequestCompleted(serverId: string, command: string, request_seq: number, meta: RequestExecutionMetadata): any;
|
|
22
|
+
traceEvent(serverId: string, event: tsp.Event): void;
|
|
23
|
+
logTrace(serverId: string, message: string, data?: any): void;
|
|
24
|
+
}
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=tracer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tracer.d.ts","sourceRoot":"","sources":["../../src/tsServer/tracer.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,GAAG,MAAM,8BAA8B,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE5C,oBAAY,KAAK;IACb,GAAG,IAAA;IACH,QAAQ,IAAA;IACR,OAAO,IAAA;CACV;AAED,oBAAY,UAAU,GAAG,KAAK,GAAG,UAAU,GAAG,SAAS,CAAC;AAExD,yBAAiB,KAAK,CAAC;IACnB,SAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,CAY/C;CACJ;AAED,UAAU,wBAAwB;IAC9B,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;CACrC;AAED,MAAM,CAAC,OAAO,OAAO,MAAM;IAEnB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,KAAK;gBADL,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,KAAK;IAI1B,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI;IAW1G,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,CAAC,QAAQ,EAAE,IAAI,EAAE,wBAAwB,GAAG,IAAI;IAW7F,qBAAqB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,wBAAwB,GAAG,GAAG;IAOlH,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC,KAAK,GAAG,IAAI;IAWpD,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,GAAG,IAAI;CAKvE"}
|
|
@@ -0,0 +1,80 @@
|
|
|
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 Trace;
|
|
12
|
+
(function (Trace) {
|
|
13
|
+
Trace[Trace["Off"] = 0] = "Off";
|
|
14
|
+
Trace[Trace["Messages"] = 1] = "Messages";
|
|
15
|
+
Trace[Trace["Verbose"] = 2] = "Verbose";
|
|
16
|
+
})(Trace = Trace || (Trace = {}));
|
|
17
|
+
(function (Trace) {
|
|
18
|
+
function fromString(value) {
|
|
19
|
+
value = value.toLowerCase();
|
|
20
|
+
switch (value) {
|
|
21
|
+
case 'off':
|
|
22
|
+
return Trace.Off;
|
|
23
|
+
case 'messages':
|
|
24
|
+
return Trace.Messages;
|
|
25
|
+
case 'verbose':
|
|
26
|
+
return Trace.Verbose;
|
|
27
|
+
default:
|
|
28
|
+
return Trace.Off;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
Trace.fromString = fromString;
|
|
32
|
+
})(Trace = Trace || (Trace = {}));
|
|
33
|
+
export default class Tracer {
|
|
34
|
+
constructor(logger, trace) {
|
|
35
|
+
this.logger = logger;
|
|
36
|
+
this.trace = trace;
|
|
37
|
+
}
|
|
38
|
+
traceRequest(serverId, request, responseExpected, queueLength) {
|
|
39
|
+
if (this.trace === Trace.Off) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
let data = undefined;
|
|
43
|
+
if (this.trace === Trace.Verbose && request.arguments) {
|
|
44
|
+
data = `Arguments: ${JSON.stringify(request.arguments, null, 4)}`;
|
|
45
|
+
}
|
|
46
|
+
this.logTrace(serverId, `Sending request: ${request.command} (${request.seq}). Response expected: ${responseExpected ? 'yes' : 'no'}. Current queue length: ${queueLength}`, data);
|
|
47
|
+
}
|
|
48
|
+
traceResponse(serverId, response, meta) {
|
|
49
|
+
if (this.trace === Trace.Off) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
let data = undefined;
|
|
53
|
+
if (this.trace === Trace.Verbose && response.body) {
|
|
54
|
+
data = `Result: ${JSON.stringify(response.body, null, 4)}`;
|
|
55
|
+
}
|
|
56
|
+
this.logTrace(serverId, `Response received: ${response.command} (${response.request_seq}). Request took ${Date.now() - meta.queuingStartTime} ms. Success: ${response.success} ${!response.success ? `. Message: ${response.message}` : ''}`, data);
|
|
57
|
+
}
|
|
58
|
+
traceRequestCompleted(serverId, command, request_seq, meta) {
|
|
59
|
+
if (this.trace === Trace.Off) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
this.logTrace(serverId, `Async response received: ${command} (${request_seq}). Request took ${Date.now() - meta.queuingStartTime} ms.`);
|
|
63
|
+
}
|
|
64
|
+
traceEvent(serverId, event) {
|
|
65
|
+
if (this.trace === Trace.Off) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
let data = undefined;
|
|
69
|
+
if (this.trace === Trace.Verbose && event.body) {
|
|
70
|
+
data = `Data: ${JSON.stringify(event.body, null, 4)}`;
|
|
71
|
+
}
|
|
72
|
+
this.logTrace(serverId, `Event received: ${event.event} (${event.seq}).`, data);
|
|
73
|
+
}
|
|
74
|
+
logTrace(serverId, message, data) {
|
|
75
|
+
if (this.trace !== Trace.Off) {
|
|
76
|
+
this.logger.trace('Trace', `<${serverId}> ${message}`, data);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=tracer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tracer.js","sourceRoot":"","sources":["../../src/tsServer/tracer.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;;;;GAKG;AAOH,MAAM,CAAN,IAAY,KAIX;AAJD,WAAY,KAAK;IACb,+BAAG,CAAA;IACH,yCAAQ,CAAA;IACR,uCAAO,CAAA;AACX,CAAC,EAJW,KAAK,GAAL,KAAK,KAAL,KAAK,QAIhB;AAID,WAAiB,KAAK;IAClB,SAAgB,UAAU,CAAC,KAAa;QACpC,KAAK,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC;QAC5B,QAAQ,KAAK,EAAE;YACX,KAAK,KAAK;gBACN,OAAO,KAAK,CAAC,GAAG,CAAC;YACrB,KAAK,UAAU;gBACX,OAAO,KAAK,CAAC,QAAQ,CAAC;YAC1B,KAAK,SAAS;gBACV,OAAO,KAAK,CAAC,OAAO,CAAC;YACzB;gBACI,OAAO,KAAK,CAAC,GAAG,CAAC;SACxB;IACL,CAAC;IAZe,gBAAU,aAYzB,CAAA;AACL,CAAC,EAdgB,KAAK,GAAL,KAAK,KAAL,KAAK,QAcrB;AAMD,MAAM,CAAC,OAA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 +1,6 @@
|
|
|
1
|
-
import API from '
|
|
2
|
-
import {
|
|
3
|
-
import type { Logger } from '../logger.js';
|
|
1
|
+
import API from '../utils/api.js';
|
|
2
|
+
import type { TypeScriptServiceConfiguration } from '../utils/configuration.js';
|
|
3
|
+
import type { Logger } from '../utils/logger.js';
|
|
4
4
|
export declare const enum TypeScriptVersionSource {
|
|
5
5
|
Bundled = "bundled",
|
|
6
6
|
UserSetting = "user-setting",
|
|
@@ -9,10 +9,10 @@ export declare const enum TypeScriptVersionSource {
|
|
|
9
9
|
export declare class TypeScriptVersion {
|
|
10
10
|
readonly source: TypeScriptVersionSource;
|
|
11
11
|
readonly path: string;
|
|
12
|
+
private readonly logger;
|
|
12
13
|
private readonly _pathLabel?;
|
|
13
|
-
private readonly logger?;
|
|
14
14
|
private _api;
|
|
15
|
-
constructor(source: TypeScriptVersionSource, path: string,
|
|
15
|
+
constructor(source: TypeScriptVersionSource, path: string, logger: Logger, _pathLabel?: string | undefined);
|
|
16
16
|
get tscPath(): string;
|
|
17
17
|
get tsServerPath(): string;
|
|
18
18
|
get pathLabel(): string;
|
|
@@ -23,9 +23,9 @@ export declare class TypeScriptVersion {
|
|
|
23
23
|
}
|
|
24
24
|
export declare const MODULE_FOLDERS: string[];
|
|
25
25
|
export declare class TypeScriptVersionProvider {
|
|
26
|
-
private configuration
|
|
27
|
-
private logger
|
|
28
|
-
constructor(configuration
|
|
26
|
+
private configuration;
|
|
27
|
+
private logger;
|
|
28
|
+
constructor(configuration: TypeScriptServiceConfiguration, logger: Logger);
|
|
29
29
|
getUserSettingVersion(): TypeScriptVersion | null;
|
|
30
30
|
getWorkspaceVersion(workspaceFolders: string[]): TypeScriptVersion | null;
|
|
31
31
|
bundledVersion(): TypeScriptVersion | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"versionProvider.d.ts","sourceRoot":"","sources":["../../src/tsServer/versionProvider.ts"],"names":[],"mappings":"AAgBA,OAAO,GAAG,MAAM,iBAAiB,CAAC;AAClC,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,2BAA2B,CAAC;AAEhF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,0BAAkB,uBAAuB;IACrC,OAAO,YAAY;IACnB,WAAW,iBAAiB;IAC5B,SAAS,cAAc;CAC1B;AAED,qBAAa,iBAAiB;aAGN,MAAM,EAAE,uBAAuB;aAC/B,IAAI,EAAE,MAAM;IAC5B,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC;IALhC,OAAO,CAAC,IAAI,CAAyB;gBAEjB,MAAM,EAAE,uBAAuB,EAC/B,IAAI,EAAE,MAAM,EACX,MAAM,EAAE,MAAM,EACd,UAAU,CAAC,oBAAQ;IAKxC,IAAW,OAAO,IAAI,MAAM,CAE3B;IAED,IAAW,YAAY,IAAI,MAAM,CAEhC;IAED,IAAW,SAAS,IAAI,MAAM,CAE7B;IAED,IAAW,OAAO,IAAI,OAAO,CAE5B;IAED,IAAW,OAAO,IAAI,GAAG,GAAG,IAAI,CAM/B;IAED,IAAW,aAAa,IAAI,MAAM,GAAG,IAAI,CAGxC;IAED,OAAO,CAAC,oBAAoB;CA0C/B;AAED,eAAO,MAAM,cAAc,UAAgG,CAAC;AAE5H,qBAAa,yBAAyB;IACf,OAAO,CAAC,aAAa;IAAkC,OAAO,CAAC,MAAM;gBAA7D,aAAa,EAAE,8BAA8B,EAAU,MAAM,EAAE,MAAM;IAEzF,qBAAqB,IAAI,iBAAiB,GAAG,IAAI;IAyCjD,mBAAmB,CAAC,gBAAgB,EAAE,MAAM,EAAE,GAAG,iBAAiB,GAAG,IAAI;IAazE,cAAc,IAAI,iBAAiB,GAAG,IAAI;CAWpD"}
|
|
@@ -2,19 +2,25 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
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
|
+
*/
|
|
5
11
|
import fs from 'node:fs';
|
|
6
12
|
import { createRequire } from 'node:module';
|
|
7
13
|
import path from 'node:path';
|
|
8
14
|
import which from 'which';
|
|
9
15
|
import { pkgUpSync } from 'pkg-up';
|
|
10
|
-
import API from '
|
|
11
|
-
import { findPathToModule } from '
|
|
16
|
+
import API from '../utils/api.js';
|
|
17
|
+
import { findPathToModule } from '../utils/modules-resolver.js';
|
|
12
18
|
export class TypeScriptVersion {
|
|
13
|
-
constructor(source, path,
|
|
19
|
+
constructor(source, path, logger, _pathLabel) {
|
|
14
20
|
this.source = source;
|
|
15
21
|
this.path = path;
|
|
16
|
-
this._pathLabel = _pathLabel;
|
|
17
22
|
this.logger = logger;
|
|
23
|
+
this._pathLabel = _pathLabel;
|
|
18
24
|
this._api = null;
|
|
19
25
|
}
|
|
20
26
|
get tscPath() {
|
|
@@ -41,14 +47,14 @@ export class TypeScriptVersion {
|
|
|
41
47
|
return version ? version.displayName : null;
|
|
42
48
|
}
|
|
43
49
|
getTypeScriptVersion(serverPath) {
|
|
44
|
-
this.logger
|
|
50
|
+
this.logger.log(`Resolving TypeScript version from path "${serverPath}"...`);
|
|
45
51
|
if (!fs.existsSync(serverPath)) {
|
|
46
|
-
this.logger
|
|
52
|
+
this.logger.log('Server path does not exist on disk');
|
|
47
53
|
return null;
|
|
48
54
|
}
|
|
49
55
|
const p = serverPath.split(path.sep);
|
|
50
56
|
if (p.length <= 2) {
|
|
51
|
-
this.logger
|
|
57
|
+
this.logger.log('Server path is invalid (has less than two path components).');
|
|
52
58
|
return null;
|
|
53
59
|
}
|
|
54
60
|
const p2 = p.slice(0, -2);
|
|
@@ -61,24 +67,24 @@ export class TypeScriptVersion {
|
|
|
61
67
|
}
|
|
62
68
|
}
|
|
63
69
|
if (!fs.existsSync(fileName)) {
|
|
64
|
-
this.logger
|
|
70
|
+
this.logger.log(`Failed to find package.json at path "${fileName}"`);
|
|
65
71
|
return null;
|
|
66
72
|
}
|
|
67
|
-
this.logger
|
|
73
|
+
this.logger.log(`Reading version from package.json at "${fileName}"`);
|
|
68
74
|
const contents = fs.readFileSync(fileName).toString();
|
|
69
75
|
let desc = null;
|
|
70
76
|
try {
|
|
71
77
|
desc = JSON.parse(contents);
|
|
72
78
|
}
|
|
73
79
|
catch (err) {
|
|
74
|
-
this.logger
|
|
80
|
+
this.logger.log('Failed parsing contents of package.json.');
|
|
75
81
|
return null;
|
|
76
82
|
}
|
|
77
83
|
if (!desc || !desc.version) {
|
|
78
|
-
this.logger
|
|
84
|
+
this.logger.log('Failed reading version number from package.json.');
|
|
79
85
|
return null;
|
|
80
86
|
}
|
|
81
|
-
this.logger
|
|
87
|
+
this.logger.log(`Resolved TypeScript version to "${desc.version}"`);
|
|
82
88
|
return API.fromVersionString(desc.version);
|
|
83
89
|
}
|
|
84
90
|
}
|
|
@@ -89,11 +95,11 @@ export class TypeScriptVersionProvider {
|
|
|
89
95
|
this.logger = logger;
|
|
90
96
|
}
|
|
91
97
|
getUserSettingVersion() {
|
|
92
|
-
const { tsserverPath } = this.configuration
|
|
98
|
+
const { tsserverPath } = this.configuration;
|
|
93
99
|
if (!tsserverPath) {
|
|
94
100
|
return null;
|
|
95
101
|
}
|
|
96
|
-
this.logger
|
|
102
|
+
this.logger.log(`Resolving user-provided tsserver path "${tsserverPath}"...`);
|
|
97
103
|
let resolvedPath = tsserverPath;
|
|
98
104
|
// Resolve full path to the binary if path is not absolute.
|
|
99
105
|
if (!path.isAbsolute(resolvedPath)) {
|
|
@@ -101,39 +107,39 @@ export class TypeScriptVersionProvider {
|
|
|
101
107
|
if (binaryPath) {
|
|
102
108
|
resolvedPath = binaryPath;
|
|
103
109
|
}
|
|
104
|
-
this.logger
|
|
110
|
+
this.logger.log(`Non-absolute tsserver path resolved to "${binaryPath ? resolvedPath : '<failed>'}"`);
|
|
105
111
|
}
|
|
106
112
|
// Resolve symbolic link.
|
|
107
113
|
let stat = fs.lstatSync(resolvedPath, { throwIfNoEntry: false });
|
|
108
114
|
if (stat?.isSymbolicLink()) {
|
|
109
115
|
resolvedPath = fs.realpathSync(resolvedPath);
|
|
110
|
-
this.logger
|
|
116
|
+
this.logger.log(`Symbolic link tsserver path resolved to "${resolvedPath}"`);
|
|
111
117
|
}
|
|
112
118
|
// Get directory path
|
|
113
119
|
stat = fs.lstatSync(resolvedPath, { throwIfNoEntry: false });
|
|
114
120
|
if (stat?.isFile()) {
|
|
115
121
|
resolvedPath = path.dirname(resolvedPath);
|
|
116
|
-
this.logger
|
|
122
|
+
this.logger.log(`Resolved directory path from a file path: ${resolvedPath}`);
|
|
117
123
|
}
|
|
118
124
|
// Resolve path to the "lib" dir.
|
|
119
125
|
try {
|
|
120
126
|
const packageJsonPath = pkgUpSync({ cwd: resolvedPath });
|
|
121
|
-
this.logger
|
|
127
|
+
this.logger.log(`Resolved package.json location: "${packageJsonPath}"`);
|
|
122
128
|
if (packageJsonPath) {
|
|
123
129
|
resolvedPath = path.join(path.dirname(packageJsonPath), 'lib');
|
|
124
|
-
this.logger
|
|
130
|
+
this.logger.log(`Assumed tsserver lib location: "${resolvedPath}"`);
|
|
125
131
|
}
|
|
126
132
|
}
|
|
127
133
|
catch {
|
|
128
134
|
// ignore
|
|
129
135
|
}
|
|
130
|
-
return new TypeScriptVersion("user-setting" /* TypeScriptVersionSource.UserSetting */, resolvedPath,
|
|
136
|
+
return new TypeScriptVersion("user-setting" /* TypeScriptVersionSource.UserSetting */, resolvedPath, this.logger, undefined);
|
|
131
137
|
}
|
|
132
138
|
getWorkspaceVersion(workspaceFolders) {
|
|
133
139
|
for (const p of workspaceFolders) {
|
|
134
140
|
const libFolder = findPathToModule(p, MODULE_FOLDERS);
|
|
135
141
|
if (libFolder) {
|
|
136
|
-
const version = new TypeScriptVersion("workspace" /* TypeScriptVersionSource.Workspace */, libFolder);
|
|
142
|
+
const version = new TypeScriptVersion("workspace" /* TypeScriptVersionSource.Workspace */, libFolder, this.logger);
|
|
137
143
|
if (version.isValid) {
|
|
138
144
|
return version;
|
|
139
145
|
}
|
|
@@ -145,7 +151,7 @@ export class TypeScriptVersionProvider {
|
|
|
145
151
|
const require = createRequire(import.meta.url);
|
|
146
152
|
try {
|
|
147
153
|
const file = require.resolve('typescript');
|
|
148
|
-
const bundledVersion = new TypeScriptVersion("bundled" /* TypeScriptVersionSource.Bundled */, path.dirname(file), '');
|
|
154
|
+
const bundledVersion = new TypeScriptVersion("bundled" /* TypeScriptVersionSource.Bundled */, path.dirname(file), this.logger, '');
|
|
149
155
|
return bundledVersion;
|
|
150
156
|
}
|
|
151
157
|
catch (e) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"versionProvider.js","sourceRoot":"","sources":["../../src/tsServer/versionProvider.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,GAAG,MAAM,iBAAiB,CAAC;AAElC,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAShE,MAAM,OAAO,iBAAiB;IAE1B,YACoB,MAA+B,EAC/B,IAAY,EACX,MAAc,EACd,UAAmB;QAHpB,WAAM,GAAN,MAAM,CAAyB;QAC/B,SAAI,GAAJ,IAAI,CAAQ;QACX,WAAM,GAAN,MAAM,CAAQ;QACd,eAAU,GAAV,UAAU,CAAS;QAEpC,IAAI,CA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AAC;gBACjG,IAAI,OAAO,CAAC,OAAO,EAAE;oBACjB,OAAO,OAAO,CAAC;iBAClB;aACJ;SACJ;QACD,OAAO,IAAI,CAAC;IAChB,CAAC;IAEM,cAAc;QACjB,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC/C,IAAI;YACA,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;YAC3C,MAAM,cAAc,GAAG,IAAI,iBAAiB,kDAAkC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;YACnH,OAAO,cAAc,CAAC;SACzB;QAAC,OAAO,CAAC,EAAE;YACR,sEAAsE;YACtE,OAAO,IAAI,CAAC;SACf;IACL,CAAC;CACJ"}
|
package/lib/tsp-client.d.ts
CHANGED
|
@@ -1,15 +1,22 @@
|
|
|
1
1
|
/// <reference types="node" resolution-mode="require"/>
|
|
2
2
|
import type tsp from 'typescript/lib/protocol.d.js';
|
|
3
|
-
import { CancellationToken } from 'vscode-jsonrpc';
|
|
3
|
+
import type { CancellationToken } from 'vscode-jsonrpc';
|
|
4
4
|
import { CommandTypes } from './tsp-command-types.js';
|
|
5
|
-
import { Logger } from './logger.js';
|
|
5
|
+
import { Logger } from './utils/logger.js';
|
|
6
6
|
import API from './utils/api.js';
|
|
7
|
+
import type { ILogDirectoryProvider } from './tsServer/logDirectoryProvider.js';
|
|
8
|
+
import { ExecConfig, ServerResponse, TypeScriptRequestTypes } from './tsServer/requests.js';
|
|
9
|
+
import { Trace } from './tsServer/tracer.js';
|
|
10
|
+
import type { TypeScriptVersion } from './tsServer/versionProvider.js';
|
|
11
|
+
import type { LspClient } from './lsp-client.js';
|
|
12
|
+
import type { TsServerLogLevel } from './utils/configuration.js';
|
|
7
13
|
export interface TspClientOptions {
|
|
8
|
-
|
|
14
|
+
lspClient: LspClient;
|
|
15
|
+
trace: Trace;
|
|
16
|
+
typescriptVersion: TypeScriptVersion;
|
|
9
17
|
logger: Logger;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
logVerbosity?: string;
|
|
18
|
+
logVerbosity: TsServerLogLevel;
|
|
19
|
+
logDirectoryProvider: ILogDirectoryProvider;
|
|
13
20
|
disableAutomaticTypingAcquisition?: boolean;
|
|
14
21
|
maxTsServerMemory?: number;
|
|
15
22
|
npmLocation?: string;
|
|
@@ -19,65 +26,28 @@ export interface TspClientOptions {
|
|
|
19
26
|
onEvent?: (event: tsp.Event) => void;
|
|
20
27
|
onExit?: (exitCode: number | null, signal: NodeJS.Signals | null) => void;
|
|
21
28
|
}
|
|
22
|
-
interface TypeScriptRequestTypes {
|
|
23
|
-
[CommandTypes.ApplyCodeActionCommand]: [tsp.ApplyCodeActionCommandRequestArgs, tsp.ApplyCodeActionCommandResponse];
|
|
24
|
-
[CommandTypes.CompilerOptionsForInferredProjects]: [tsp.SetCompilerOptionsForInferredProjectsArgs, tsp.SetCompilerOptionsForInferredProjectsResponse];
|
|
25
|
-
[CommandTypes.CompletionDetails]: [tsp.CompletionDetailsRequestArgs, tsp.CompletionDetailsResponse];
|
|
26
|
-
[CommandTypes.CompletionInfo]: [tsp.CompletionsRequestArgs, tsp.CompletionInfoResponse];
|
|
27
|
-
[CommandTypes.Configure]: [tsp.ConfigureRequestArguments, tsp.ConfigureResponse];
|
|
28
|
-
[CommandTypes.Definition]: [tsp.FileLocationRequestArgs, tsp.DefinitionResponse];
|
|
29
|
-
[CommandTypes.DefinitionAndBoundSpan]: [tsp.FileLocationRequestArgs, tsp.DefinitionInfoAndBoundSpanResponse];
|
|
30
|
-
[CommandTypes.DocCommentTemplate]: [tsp.FileLocationRequestArgs, tsp.DocCommandTemplateResponse];
|
|
31
|
-
[CommandTypes.DocumentHighlights]: [tsp.DocumentHighlightsRequestArgs, tsp.DocumentHighlightsResponse];
|
|
32
|
-
[CommandTypes.EncodedSemanticClassificationsFull]: [tsp.EncodedSemanticClassificationsRequestArgs, tsp.EncodedSemanticClassificationsResponse];
|
|
33
|
-
[CommandTypes.FindSourceDefinition]: [tsp.FileLocationRequestArgs, tsp.DefinitionResponse];
|
|
34
|
-
[CommandTypes.Format]: [tsp.FormatRequestArgs, tsp.FormatResponse];
|
|
35
|
-
[CommandTypes.Formatonkey]: [tsp.FormatOnKeyRequestArgs, tsp.FormatResponse];
|
|
36
|
-
[CommandTypes.GetApplicableRefactors]: [tsp.GetApplicableRefactorsRequestArgs, tsp.GetApplicableRefactorsResponse];
|
|
37
|
-
[CommandTypes.GetCodeFixes]: [tsp.CodeFixRequestArgs, tsp.CodeFixResponse];
|
|
38
|
-
[CommandTypes.GetCombinedCodeFix]: [tsp.GetCombinedCodeFixRequestArgs, tsp.GetCombinedCodeFixResponse];
|
|
39
|
-
[CommandTypes.GetEditsForFileRename]: [tsp.GetEditsForFileRenameRequestArgs, tsp.GetEditsForFileRenameResponse];
|
|
40
|
-
[CommandTypes.GetEditsForRefactor]: [tsp.GetEditsForRefactorRequestArgs, tsp.GetEditsForRefactorResponse];
|
|
41
|
-
[CommandTypes.Geterr]: [tsp.GeterrRequestArgs, any];
|
|
42
|
-
[CommandTypes.GetOutliningSpans]: [tsp.FileRequestArgs, tsp.OutliningSpansResponse];
|
|
43
|
-
[CommandTypes.GetSupportedCodeFixes]: [null, tsp.GetSupportedCodeFixesResponse];
|
|
44
|
-
[CommandTypes.Implementation]: [tsp.FileLocationRequestArgs, tsp.ImplementationResponse];
|
|
45
|
-
[CommandTypes.JsxClosingTag]: [tsp.JsxClosingTagRequestArgs, tsp.JsxClosingTagResponse];
|
|
46
|
-
[CommandTypes.Navto]: [tsp.NavtoRequestArgs, tsp.NavtoResponse];
|
|
47
|
-
[CommandTypes.NavTree]: [tsp.FileRequestArgs, tsp.NavTreeResponse];
|
|
48
|
-
[CommandTypes.OrganizeImports]: [tsp.OrganizeImportsRequestArgs, tsp.OrganizeImportsResponse];
|
|
49
|
-
[CommandTypes.ProjectInfo]: [tsp.ProjectInfoRequestArgs, tsp.ProjectInfoResponse];
|
|
50
|
-
[CommandTypes.ProvideInlayHints]: [tsp.InlayHintsRequestArgs, tsp.InlayHintsResponse];
|
|
51
|
-
[CommandTypes.Quickinfo]: [tsp.FileLocationRequestArgs, tsp.QuickInfoResponse];
|
|
52
|
-
[CommandTypes.References]: [tsp.FileLocationRequestArgs, tsp.ReferencesResponse];
|
|
53
|
-
[CommandTypes.Rename]: [tsp.RenameRequestArgs, tsp.RenameResponse];
|
|
54
|
-
[CommandTypes.SignatureHelp]: [tsp.SignatureHelpRequestArgs, tsp.SignatureHelpResponse];
|
|
55
|
-
[CommandTypes.TypeDefinition]: [tsp.FileLocationRequestArgs, tsp.TypeDefinitionResponse];
|
|
56
|
-
}
|
|
57
29
|
export declare class TspClient {
|
|
58
30
|
private options;
|
|
59
31
|
apiVersion: API;
|
|
60
|
-
private
|
|
61
|
-
private readlineInterface;
|
|
62
|
-
private seq;
|
|
63
|
-
private readonly deferreds;
|
|
32
|
+
private primaryTsServer;
|
|
64
33
|
private logger;
|
|
65
34
|
private tsserverLogger;
|
|
66
|
-
private
|
|
35
|
+
private loadingIndicator;
|
|
36
|
+
private tracer;
|
|
67
37
|
constructor(options: TspClientOptions);
|
|
68
38
|
start(): boolean;
|
|
39
|
+
private serviceExited;
|
|
40
|
+
private dispatchEvent;
|
|
69
41
|
shutdown(): void;
|
|
70
42
|
notify(command: CommandTypes.Open, args: tsp.OpenRequestArgs): void;
|
|
71
43
|
notify(command: CommandTypes.Close, args: tsp.FileRequestArgs): void;
|
|
72
|
-
notify(command: CommandTypes.Saveto, args: tsp.SavetoRequestArgs): void;
|
|
73
44
|
notify(command: CommandTypes.Change, args: tsp.ChangeRequestArgs): void;
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
private
|
|
80
|
-
private
|
|
45
|
+
requestGeterr(args: tsp.GeterrRequestArgs, token: CancellationToken): Promise<any>;
|
|
46
|
+
request<K extends keyof TypeScriptRequestTypes>(command: K, args: TypeScriptRequestTypes[K][0], token?: CancellationToken, config?: ExecConfig): Promise<TypeScriptRequestTypes[K][1]>;
|
|
47
|
+
execute(command: keyof TypeScriptRequestTypes, args: any, token?: CancellationToken, config?: ExecConfig): Promise<ServerResponse.Response<tsp.Response>>;
|
|
48
|
+
executeWithoutWaitingForResponse(command: keyof TypeScriptRequestTypes, args: any): void;
|
|
49
|
+
executeAsync(command: keyof TypeScriptRequestTypes, args: tsp.GeterrRequestArgs, token: CancellationToken): Promise<ServerResponse.Response<tsp.Response>>;
|
|
50
|
+
private executeImpl;
|
|
51
|
+
private fatalError;
|
|
81
52
|
}
|
|
82
|
-
export {};
|
|
83
53
|
//# sourceMappingURL=tsp-client.d.ts.map
|
package/lib/tsp-client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tsp-client.d.ts","sourceRoot":"","sources":["../src/tsp-client.ts"],"names":[],"mappings":";AAWA,OAAO,KAAK,GAAG,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"tsp-client.d.ts","sourceRoot":"","sources":["../src/tsp-client.ts"],"names":[],"mappings":";AAWA,OAAO,KAAK,GAAG,MAAM,8BAA8B,CAAC;AAEpD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAc,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,MAAM,EAAmB,MAAM,mBAAmB,CAAC;AAC5D,OAAO,GAAG,MAAM,gBAAgB,CAAC;AACjC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAChF,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAI5F,OAAe,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BA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