typescript-language-server 2.1.0 → 2.2.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 +15 -0
- package/README.md +1 -0
- package/lib/calls.d.ts +1 -1
- package/lib/calls.d.ts.map +1 -1
- package/lib/calls.js +4 -3
- package/lib/calls.js.map +1 -1
- package/lib/completion.d.ts +1 -2
- package/lib/completion.d.ts.map +1 -1
- package/lib/completion.js +11 -13
- package/lib/completion.js.map +1 -1
- package/lib/configuration-manager.d.ts +2 -3
- package/lib/configuration-manager.d.ts.map +1 -1
- package/lib/configuration-manager.js +6 -4
- package/lib/configuration-manager.js.map +1 -1
- package/lib/diagnostic-queue.d.ts +1 -2
- package/lib/diagnostic-queue.d.ts.map +1 -1
- package/lib/diagnostic-queue.js.map +1 -1
- package/lib/document-symbol.d.ts +1 -1
- package/lib/document-symbol.d.ts.map +1 -1
- package/lib/document-symbol.js +2 -2
- package/lib/document-symbol.js.map +1 -1
- package/lib/features/fix-all.d.ts.map +1 -1
- package/lib/features/fix-all.js +8 -6
- package/lib/features/fix-all.js.map +1 -1
- package/lib/features/inlay-hints.d.ts.map +1 -1
- package/lib/features/inlay-hints.js +2 -1
- package/lib/features/inlay-hints.js.map +1 -1
- package/lib/features/source-definition.js +2 -1
- package/lib/features/source-definition.js.map +1 -1
- package/lib/hover.d.ts +1 -1
- package/lib/hover.d.ts.map +1 -1
- package/lib/lsp-connection.d.ts.map +1 -1
- package/lib/lsp-connection.js +1 -0
- package/lib/lsp-connection.js.map +1 -1
- package/lib/lsp-protocol.inlayHints.proposed.d.ts +5 -5
- package/lib/lsp-protocol.inlayHints.proposed.d.ts.map +1 -1
- package/lib/lsp-server.d.ts +7 -4
- package/lib/lsp-server.d.ts.map +1 -1
- package/lib/lsp-server.js +55 -41
- package/lib/lsp-server.js.map +1 -1
- package/lib/lsp-server.spec.js +4 -4
- package/lib/lsp-server.spec.js.map +1 -1
- package/lib/organize-imports.d.ts +1 -1
- package/lib/organize-imports.d.ts.map +1 -1
- package/lib/organize-imports.js.map +1 -1
- package/lib/organize-imports.spec.js.map +1 -1
- package/lib/protocol-translation.d.ts +1 -2
- package/lib/protocol-translation.d.ts.map +1 -1
- package/lib/protocol-translation.js +4 -11
- package/lib/protocol-translation.js.map +1 -1
- package/lib/quickfix.d.ts +1 -1
- package/lib/quickfix.d.ts.map +1 -1
- package/lib/quickfix.js.map +1 -1
- package/lib/refactor.d.ts +1 -2
- package/lib/refactor.d.ts.map +1 -1
- package/lib/refactor.js.map +1 -1
- package/lib/ts-protocol.d.ts +29 -14
- package/lib/ts-protocol.d.ts.map +1 -1
- package/lib/ts-protocol.js +50 -13
- package/lib/ts-protocol.js.map +1 -1
- package/lib/tsServer/callbackMap.d.ts +1 -1
- package/lib/tsServer/callbackMap.d.ts.map +1 -1
- package/lib/tsServer/callbackMap.js.map +1 -1
- package/lib/tsServer/requestQueue.d.ts +1 -1
- package/lib/tsServer/requestQueue.d.ts.map +1 -1
- package/lib/tsServer/requests.d.ts +3 -3
- package/lib/tsServer/requests.d.ts.map +1 -1
- package/lib/tsServer/requests.js +2 -0
- package/lib/tsServer/requests.js.map +1 -1
- package/lib/tsServer/server.d.ts +9 -4
- package/lib/tsServer/server.d.ts.map +1 -1
- package/lib/tsServer/server.js +7 -0
- package/lib/tsServer/server.js.map +1 -1
- package/lib/tsServer/serverError.d.ts +1 -1
- package/lib/tsServer/serverError.d.ts.map +1 -1
- package/lib/tsServer/serverError.js +4 -4
- package/lib/tsServer/serverError.js.map +1 -1
- package/lib/tsServer/serverProcess.d.ts.map +1 -1
- package/lib/tsServer/serverProcess.js +8 -1
- package/lib/tsServer/serverProcess.js.map +1 -1
- package/lib/tsServer/tracer.d.ts +2 -2
- package/lib/tsServer/tracer.d.ts.map +1 -1
- package/lib/tsp-client.d.ts +2 -2
- package/lib/tsp-client.d.ts.map +1 -1
- package/lib/tsp-client.js +10 -2
- package/lib/tsp-client.js.map +1 -1
- package/lib/tsp-client.spec.js +11 -9
- package/lib/tsp-client.spec.js.map +1 -1
- package/lib/utils/SnippetString.js +4 -4
- package/lib/utils/SnippetString.js.map +1 -1
- package/lib/utils/api.d.ts +2 -0
- package/lib/utils/api.d.ts.map +1 -1
- package/lib/utils/api.js +17 -15
- package/lib/utils/api.js.map +1 -1
- package/lib/utils/logger.d.ts +1 -1
- package/lib/utils/logger.d.ts.map +1 -1
- package/lib/utils/previewer.d.ts +1 -1
- package/lib/utils/previewer.d.ts.map +1 -1
- package/lib/utils/previewer.js.map +1 -1
- package/lib/utils/tsconfig.d.ts +1 -1
- package/lib/utils/tsconfig.d.ts.map +1 -1
- package/lib/utils/tsconfig.js +5 -4
- package/lib/utils/tsconfig.js.map +1 -1
- package/lib/utils/typeConverters.d.ts +1 -1
- package/lib/utils/typeConverters.d.ts.map +1 -1
- package/package.json +16 -16
- package/lib/tsp-command-types.d.ts +0 -188
- package/lib/tsp-command-types.d.ts.map +0 -1
- package/lib/tsp-command-types.js +0 -99
- package/lib/tsp-command-types.js.map +0 -1
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
import API from '../utils/api.js';
|
|
12
12
|
import { Position } from '../utils/typeConverters.js';
|
|
13
13
|
import { toLocation, uriToPath } from '../protocol-translation.js';
|
|
14
|
+
import { tsp } from '../ts-protocol.js';
|
|
14
15
|
export class SourceDefinitionCommand {
|
|
15
16
|
static async execute(uri, position, documents, tspClient, lspClient, reporter) {
|
|
16
17
|
if (tspClient.apiVersion.lt(SourceDefinitionCommand.minVersion)) {
|
|
@@ -36,7 +37,7 @@ export class SourceDefinitionCommand {
|
|
|
36
37
|
message: 'Finding source definitions…',
|
|
37
38
|
reporter,
|
|
38
39
|
}, async () => {
|
|
39
|
-
const response = await tspClient.request(
|
|
40
|
+
const response = await tspClient.request(tsp.CommandTypes.FindSourceDefinition, args);
|
|
40
41
|
if (response.type !== 'response' || !response.body) {
|
|
41
42
|
lspClient.showErrorMessage('No source definitions found.');
|
|
42
43
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source-definition.js","sourceRoot":"","sources":["../../src/features/source-definition.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH;;;gGAGgG;AAGhG,OAAO,GAAG,MAAM,iBAAiB,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"source-definition.js","sourceRoot":"","sources":["../../src/features/source-definition.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH;;;gGAGgG;AAGhG,OAAO,GAAG,MAAM,iBAAiB,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAInE,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAExC,MAAM,OAAO,uBAAuB;IAIzB,MAAM,CAAC,KAAK,CAAC,OAAO,CACvB,GAAgC,EAChC,QAAkC,EAClC,SAAuB,EACvB,SAAoB,EACpB,SAAoB,EACpB,QAAsC;QAEtC,IAAI,SAAS,CAAC,UAAU,CAAC,EAAE,CAAC,uBAAuB,CAAC,UAAU,CAAC,EAAE;YAC7D,SAAS,CAAC,gBAAgB,CAAC,2DAA2D,CAAC,CAAC;YACxF,OAAO;SACV;QAED,IAAI,CAAC,QAAQ,IAAI,OAAO,QAAQ,CAAC,SAAS,KAAK,QAAQ,IAAI,OAAO,QAAQ,CAAC,IAAI,KAAK,QAAQ,EAAE;YAC1F,SAAS,CAAC,gBAAgB,CAAC,mDAAmD,CAAC,CAAC;YAChF,OAAO;SACV;QAED,IAAI,IAAwB,CAAC;QAE7B,IAAI,CAAC,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,CAAC,CAAC,IAAI,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,EAAE;YAC7D,SAAS,CAAC,gBAAgB,CAAC,uDAAuD,CAAC,CAAC;YACpF,OAAO;SACV;QAED,MAAM,QAAQ,GAAG,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAErC,IAAI,CAAC,QAAQ,EAAE;YACX,SAAS,CAAC,gBAAgB,CAAC,gEAAgE,CAAC,CAAC;YAC7F,OAAO;SACV;QAED,MAAM,IAAI,GAAG,QAAQ,CAAC,yBAAyB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QAChE,OAAO,MAAM,SAAS,CAAC,YAAY,CAAwB;YACvD,OAAO,EAAE,6BAA6B;YACtC,QAAQ;SACX,EAAE,KAAK,IAAI,EAAE;YACV,MAAM,QAAQ,GAAG,MAAM,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,oBAAoB,EAAE,IAAI,CAAC,CAAC;YACtF,IAAI,QAAQ,CAAC,IAAI,KAAK,UAAU,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE;gBAChD,SAAS,CAAC,gBAAgB,CAAC,8BAA8B,CAAC,CAAC;gBAC3D,OAAO;aACV;YACD,OAAO,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC,UAAU,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC;QAC5E,CAAC,CAAC,CAAC;IACP,CAAC;;AA/CsB,0BAAE,GAAG,kCAAkC,CAAC;AACxC,kCAAU,GAAG,GAAG,CAAC,IAAI,CAAC"}
|
package/lib/hover.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as lsp from 'vscode-languageserver';
|
|
2
|
-
import type tsp from '
|
|
2
|
+
import type { tsp } from './ts-protocol.js';
|
|
3
3
|
import { IFilePathToResourceConverter } from './utils/previewer.js';
|
|
4
4
|
export declare function asSignatureHelp(info: tsp.SignatureHelpItems, context: lsp.SignatureHelpContext | undefined, filePathConverter: IFilePathToResourceConverter): lsp.SignatureHelp;
|
|
5
5
|
export declare function toTsTriggerReason(context: lsp.SignatureHelpContext): tsp.SignatureHelpTriggerReason;
|
package/lib/hover.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hover.d.ts","sourceRoot":"","sources":["../src/hover.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,GAAG,MAAM,uBAAuB,CAAC;AAC7C,OAAO,KAAK,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"hover.d.ts","sourceRoot":"","sources":["../src/hover.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,GAAG,MAAM,uBAAuB,CAAC;AAC7C,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AAEpE,wBAAgB,eAAe,CAC3B,IAAI,EAAE,GAAG,CAAC,kBAAkB,EAC5B,OAAO,EAAE,GAAG,CAAC,oBAAoB,GAAG,SAAS,EAC7C,iBAAiB,EAAE,4BAA4B,GAChD,GAAG,CAAC,aAAa,CAOnB;AA6CD,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,GAAG,CAAC,oBAAoB,GAAG,GAAG,CAAC,0BAA0B,CAkBnG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lsp-connection.d.ts","sourceRoot":"","sources":["../src/lsp-connection.ts"],"names":[],"mappings":"AAOA,OAAO,GAAG,MAAM,+BAA+B,CAAC;AAMhD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAEjE,MAAM,WAAW,oBAAoB;IACjC,mBAAmB,EAAE,MAAM,CAAC;IAC5B,2BAA2B,EAAE,gBAAgB,CAAC;IAC9C,gBAAgB,EAAE,GAAG,CAAC,WAAW,CAAC;CACrC;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,oBAAoB,GAAG,GAAG,CAAC,UAAU,
|
|
1
|
+
{"version":3,"file":"lsp-connection.d.ts","sourceRoot":"","sources":["../src/lsp-connection.ts"],"names":[],"mappings":"AAOA,OAAO,GAAG,MAAM,+BAA+B,CAAC;AAMhD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAEjE,MAAM,WAAW,oBAAoB;IACjC,mBAAmB,EAAE,MAAM,CAAC;IAC5B,2BAA2B,EAAE,gBAAgB,CAAC;IAC9C,gBAAgB,EAAE,GAAG,CAAC,WAAW,CAAC;CACrC;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,oBAAoB,GAAG,GAAG,CAAC,UAAU,CAgDjF"}
|
package/lib/lsp-connection.js
CHANGED
|
@@ -40,6 +40,7 @@ export function createLspConnection(options) {
|
|
|
40
40
|
connection.onHover(server.hover.bind(server));
|
|
41
41
|
connection.onReferences(server.references.bind(server));
|
|
42
42
|
connection.onRenameRequest(server.rename.bind(server));
|
|
43
|
+
connection.onPrepareRename(server.prepareRename.bind(server));
|
|
43
44
|
connection.onSignatureHelp(server.signatureHelp.bind(server));
|
|
44
45
|
connection.onWorkspaceSymbol(server.workspaceSymbol.bind(server));
|
|
45
46
|
connection.onFoldingRanges(server.foldingRanges.bind(server));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lsp-connection.js","sourceRoot":"","sources":["../src/lsp-connection.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,GAAG,MAAM,+BAA+B,CAAC;AAChD,OAAO,KAAK,QAAQ,MAAM,kCAAkC,CAAC;AAC7D,OAAO,KAAK,aAAa,MAAM,uCAAuC,CAAC;AACvE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAShD,MAAM,UAAU,mBAAmB,CAAC,OAA6B;IAC7D,MAAM,UAAU,GAAG,GAAG,CAAC,gBAAgB,C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,eAAe,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAC9D,UAAU,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAElE,wCAAwC;IACxC,UAAU,CAAC,SAAS,CAAC,QAAQ,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAE5E,UAAU,CAAC,SAAS,CAAC,aAAa,CAAC,IAAI,EAAE,MAAM,CAAC,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAE/E,UAAU,CAAC,SAAS,CAAC,GAAG,CAAC,qBAAqB,CAAC,IAAI,EAAE,MAAM,CAAC,kBAAkB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAC7F,UAAU,CAAC,SAAS,CAAC,GAAG,CAAC,0BAA0B,CAAC,IAAI,EAAE,MAAM,CAAC,mBAAmB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAEnG,OAAO,UAAU,CAAC;AACtB,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as lsp from 'vscode-languageserver';
|
|
2
|
-
import type tsp from 'typescript/lib/protocol.d.js';
|
|
3
2
|
import { RequestHandler } from 'vscode-jsonrpc';
|
|
4
|
-
|
|
3
|
+
import type { tsp } from './ts-protocol.js';
|
|
4
|
+
export type InlayHintsParams = {
|
|
5
5
|
/**
|
|
6
6
|
* The document to format.
|
|
7
7
|
*/
|
|
@@ -11,17 +11,17 @@ export declare type InlayHintsParams = {
|
|
|
11
11
|
*/
|
|
12
12
|
range?: lsp.Range;
|
|
13
13
|
};
|
|
14
|
-
|
|
14
|
+
type InlayHint = {
|
|
15
15
|
text: string;
|
|
16
16
|
position: lsp.Position;
|
|
17
17
|
kind: tsp.InlayHintKind;
|
|
18
18
|
whitespaceBefore?: boolean;
|
|
19
19
|
whitespaceAfter?: boolean;
|
|
20
20
|
};
|
|
21
|
-
export
|
|
21
|
+
export type InlayHintsResult = {
|
|
22
22
|
inlayHints: InlayHint[];
|
|
23
23
|
};
|
|
24
24
|
export declare const type: lsp.RequestType<InlayHintsParams, InlayHintsResult, lsp.TextDocumentRegistrationOptions>;
|
|
25
|
-
export
|
|
25
|
+
export type HandlerSignature = RequestHandler<InlayHintsParams, InlayHintsResult | null, void>;
|
|
26
26
|
export {};
|
|
27
27
|
//# sourceMappingURL=lsp-protocol.inlayHints.proposed.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lsp-protocol.inlayHints.proposed.d.ts","sourceRoot":"","sources":["../src/lsp-protocol.inlayHints.proposed.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,uBAAuB,CAAC;AAC7C,OAAO,
|
|
1
|
+
{"version":3,"file":"lsp-protocol.inlayHints.proposed.d.ts","sourceRoot":"","sources":["../src/lsp-protocol.inlayHints.proposed.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAE5C,MAAM,MAAM,gBAAgB,GAAG;IAC3B;;OAEG;IACH,YAAY,EAAE,GAAG,CAAC,sBAAsB,CAAC;IACzC;;OAEG;IACH,KAAK,CAAC,EAAE,GAAG,CAAC,KAAK,CAAC;CACrB,CAAC;AAEF,KAAK,SAAS,GAAG;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,GAAG,CAAC,QAAQ,CAAC;IACvB,IAAI,EAAE,GAAG,CAAC,aAAa,CAAC;IACxB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,eAAe,CAAC,EAAE,OAAO,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC3B,UAAU,EAAE,SAAS,EAAE,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAM,IAAI,0FAAwH,CAAC;AAE1I,MAAM,MAAM,gBAAgB,GAAG,cAAc,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,IAAI,EAAE,IAAI,CAAC,CAAC"}
|
package/lib/lsp-server.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import * as lsp from 'vscode-languageserver';
|
|
2
2
|
import * as lspcalls from './lsp-protocol.calls.proposed.js';
|
|
3
3
|
import * as lspinlayHints from './lsp-protocol.inlayHints.proposed.js';
|
|
4
|
-
import tsp from 'typescript/lib/protocol.d.js';
|
|
5
4
|
import { LspDocument } from './document.js';
|
|
6
|
-
import { TypeScriptInitializeParams } from './ts-protocol.js';
|
|
5
|
+
import { tsp, TypeScriptInitializeParams } from './ts-protocol.js';
|
|
7
6
|
import { TypeScriptServiceConfiguration } from './utils/configuration.js';
|
|
8
7
|
export declare class LspServer {
|
|
9
8
|
private options;
|
|
@@ -49,7 +48,11 @@ export declare class LspServer {
|
|
|
49
48
|
completionResolve(item: lsp.CompletionItem): Promise<lsp.CompletionItem>;
|
|
50
49
|
hover(params: lsp.TextDocumentPositionParams): Promise<lsp.Hover>;
|
|
51
50
|
protected getQuickInfo(file: string, position: lsp.Position): Promise<tsp.QuickInfoResponse | undefined>;
|
|
52
|
-
|
|
51
|
+
prepareRename(params: lsp.PrepareRenameParams): Promise<lsp.Range | {
|
|
52
|
+
range: lsp.Range;
|
|
53
|
+
placeholder: string;
|
|
54
|
+
} | undefined | null>;
|
|
55
|
+
rename(params: lsp.RenameParams): Promise<lsp.WorkspaceEdit | undefined | null>;
|
|
53
56
|
references(params: lsp.ReferenceParams): Promise<lsp.Location[]>;
|
|
54
57
|
documentFormatting(params: lsp.DocumentFormattingParams): Promise<lsp.TextEdit[]>;
|
|
55
58
|
documentRangeFormatting(params: lsp.DocumentRangeFormattingParams): Promise<lsp.TextEdit[]>;
|
|
@@ -72,7 +75,7 @@ export declare class LspServer {
|
|
|
72
75
|
foldingRanges(params: lsp.FoldingRangeParams): Promise<lsp.FoldingRange[] | undefined>;
|
|
73
76
|
protected asFoldingRange(span: tsp.OutliningSpan, document: LspDocument): lsp.FoldingRange | undefined;
|
|
74
77
|
protected asFoldingRangeKind(span: tsp.OutliningSpan): lsp.FoldingRangeKind | undefined;
|
|
75
|
-
protected onTsEvent(event:
|
|
78
|
+
protected onTsEvent(event: tsp.Event): Promise<void>;
|
|
76
79
|
calls(params: lspcalls.CallsParams): Promise<lspcalls.CallsResult>;
|
|
77
80
|
inlayHints(params: lsp.InlayHintParams): Promise<lsp.InlayHint[] | undefined>;
|
|
78
81
|
inlayHintsLegacy(params: lspinlayHints.InlayHintsParams): Promise<lspinlayHints.InlayHintsResult>;
|
package/lib/lsp-server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lsp-server.d.ts","sourceRoot":"","sources":["../src/lsp-server.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,GAAG,MAAM,uBAAuB,CAAC;AAC7C,OAAO,KAAK,QAAQ,MAAM,kCAAkC,CAAC;AAC7D,OAAO,KAAK,aAAa,MAAM,uCAAuC,CAAC;
|
|
1
|
+
{"version":3,"file":"lsp-server.d.ts","sourceRoot":"","sources":["../src/lsp-server.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,GAAG,MAAM,uBAAuB,CAAC;AAC7C,OAAO,KAAK,QAAQ,MAAM,kCAAkC,CAAC;AAC7D,OAAO,KAAK,aAAa,MAAM,uCAAuC,CAAC;AAOvE,OAAO,EAAgB,WAAW,EAAE,MAAM,eAAe,CAAC;AAO1D,OAAO,EAAE,GAAG,EAAc,0BAA0B,EAAsD,MAAM,kBAAkB,CAAC;AAGnI,OAAO,EAAoB,8BAA8B,EAAE,MAAM,0BAA0B,CAAC;AAgB5F,qBAAa,SAAS;IAYN,OAAO,CAA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AK,GAAG,OAAO,CAAC,IAAI,CAAC;IAMpD,KAAK,CAAC,MAAM,EAAE,QAAQ,CAAC,WAAW,GAAG,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC;IAgBlE,UAAU,CAAC,MAAM,EAAE,GAAG,CAAC,eAAe,GAAG,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,GAAG,SAAS,CAAC;IAK7E,gBAAgB,CAAC,MAAM,EAAE,aAAa,CAAC,gBAAgB,GAAG,OAAO,CAAC,aAAa,CAAC,gBAAgB,CAAC;IAsDjG,kBAAkB,CAAC,MAAM,EAAE,GAAG,CAAC,oBAAoB,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC;IAwBjF,mBAAmB,CAAC,MAAM,EAAE,GAAG,CAAC,yBAAyB,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC;IAkBvF,iBAAiB,CAAC,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAI,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC;CAkBhI"}
|
package/lib/lsp-server.js
CHANGED
|
@@ -22,6 +22,7 @@ import { Commands } from './commands.js';
|
|
|
22
22
|
import { provideQuickFix } from './quickfix.js';
|
|
23
23
|
import { provideRefactors } from './refactor.js';
|
|
24
24
|
import { provideOrganizeImports } from './organize-imports.js';
|
|
25
|
+
import { tsp } from './ts-protocol.js';
|
|
25
26
|
import { collectDocumentSymbols, collectSymbolInformation } from './document-symbol.js';
|
|
26
27
|
import { computeCallers, computeCallees } from './calls.js';
|
|
27
28
|
import { TsServerLogLevel } from './utils/configuration.js';
|
|
@@ -37,6 +38,7 @@ import { getInferredProjectCompilerOptions } from './utils/tsconfig.js';
|
|
|
37
38
|
import { Position, Range } from './utils/typeConverters.js';
|
|
38
39
|
import { CodeActionKind } from './utils/types.js';
|
|
39
40
|
import { ConfigurationManager } from './configuration-manager.js';
|
|
41
|
+
var CommandTypes = tsp.CommandTypes;
|
|
40
42
|
export class LspServer {
|
|
41
43
|
constructor(options) {
|
|
42
44
|
this.options = options;
|
|
@@ -137,10 +139,10 @@ export class LspServer {
|
|
|
137
139
|
logger: this.options.logger,
|
|
138
140
|
onEvent: this.onTsEvent.bind(this),
|
|
139
141
|
onExit: (exitCode, signal) => {
|
|
142
|
+
this.shutdown();
|
|
140
143
|
if (exitCode) {
|
|
141
|
-
|
|
144
|
+
throw new Error(`tsserver process has exited (exit code: ${exitCode}, signal: ${signal}). Stopping the server.`);
|
|
142
145
|
}
|
|
143
|
-
this.shutdown();
|
|
144
146
|
},
|
|
145
147
|
});
|
|
146
148
|
const started = this.tspClient.start();
|
|
@@ -156,6 +158,7 @@ export class LspServer {
|
|
|
156
158
|
this.typeScriptAutoFixProvider = new TypeScriptAutoFixProvider(this.tspClient);
|
|
157
159
|
this.configurationManager.setAndConfigureTspClient(this.workspaceRoot, this._tspClient, hostInfo);
|
|
158
160
|
this.setCompilerOptionsForInferredProjects();
|
|
161
|
+
const prepareSupport = textDocument?.rename?.prepareSupport && this.tspClient.apiVersion.gte(API.v310);
|
|
159
162
|
const initializeResult = {
|
|
160
163
|
capabilities: {
|
|
161
164
|
textDocumentSync: lsp.TextDocumentSyncKind.Incremental,
|
|
@@ -188,7 +191,7 @@ export class LspServer {
|
|
|
188
191
|
},
|
|
189
192
|
hoverProvider: true,
|
|
190
193
|
inlayHintProvider: true,
|
|
191
|
-
renameProvider: true,
|
|
194
|
+
renameProvider: prepareSupport ? { prepareProvider: true } : true,
|
|
192
195
|
referencesProvider: true,
|
|
193
196
|
signatureHelpProvider: {
|
|
194
197
|
triggerCharacters: ['(', ',', '<'],
|
|
@@ -278,7 +281,7 @@ export class LspServer {
|
|
|
278
281
|
resolveJsonModule: true,
|
|
279
282
|
},
|
|
280
283
|
};
|
|
281
|
-
this.tspClient.executeWithoutWaitingForResponse(
|
|
284
|
+
this.tspClient.executeWithoutWaitingForResponse(CommandTypes.CompilerOptionsForInferredProjects, args);
|
|
282
285
|
}
|
|
283
286
|
didChangeConfiguration(params) {
|
|
284
287
|
this.configurationManager.setWorkspaceConfiguration(params.settings || {});
|
|
@@ -326,7 +329,7 @@ export class LspServer {
|
|
|
326
329
|
return;
|
|
327
330
|
}
|
|
328
331
|
if (this.documents.open(file, params.textDocument)) {
|
|
329
|
-
this.tspClient.notify(
|
|
332
|
+
this.tspClient.notify(CommandTypes.Open, {
|
|
330
333
|
file,
|
|
331
334
|
fileContent: params.textDocument.text,
|
|
332
335
|
scriptKindName: this.getScriptKindName(params.textDocument.languageId),
|
|
@@ -368,7 +371,7 @@ export class LspServer {
|
|
|
368
371
|
if (!document) {
|
|
369
372
|
return;
|
|
370
373
|
}
|
|
371
|
-
this.tspClient.notify(
|
|
374
|
+
this.tspClient.notify(CommandTypes.Close, { file });
|
|
372
375
|
// We won't be updating diagnostics anymore for that file, so clear them
|
|
373
376
|
// so we don't leave stale ones.
|
|
374
377
|
this.options.lspClient.publishDiagnostics({
|
|
@@ -409,7 +412,7 @@ export class LspServer {
|
|
|
409
412
|
endLine = endPos.line + 1;
|
|
410
413
|
endOffset = endPos.character + 1;
|
|
411
414
|
}
|
|
412
|
-
this.tspClient.notify(
|
|
415
|
+
this.tspClient.notify(CommandTypes.Change, {
|
|
413
416
|
file,
|
|
414
417
|
line,
|
|
415
418
|
offset,
|
|
@@ -426,19 +429,19 @@ export class LspServer {
|
|
|
426
429
|
}
|
|
427
430
|
async definition(params) {
|
|
428
431
|
return this.getDefinition({
|
|
429
|
-
type: this.features.definitionLinkSupport ?
|
|
432
|
+
type: this.features.definitionLinkSupport ? CommandTypes.DefinitionAndBoundSpan : CommandTypes.Definition,
|
|
430
433
|
params,
|
|
431
434
|
});
|
|
432
435
|
}
|
|
433
436
|
async implementation(params) {
|
|
434
437
|
return this.getSymbolLocations({
|
|
435
|
-
type:
|
|
438
|
+
type: CommandTypes.Implementation,
|
|
436
439
|
params,
|
|
437
440
|
});
|
|
438
441
|
}
|
|
439
442
|
async typeDefinition(params) {
|
|
440
443
|
return this.getSymbolLocations({
|
|
441
|
-
type:
|
|
444
|
+
type: CommandTypes.TypeDefinition,
|
|
442
445
|
params,
|
|
443
446
|
});
|
|
444
447
|
}
|
|
@@ -448,7 +451,7 @@ export class LspServer {
|
|
|
448
451
|
if (!file) {
|
|
449
452
|
return undefined;
|
|
450
453
|
}
|
|
451
|
-
if (type ===
|
|
454
|
+
if (type === CommandTypes.DefinitionAndBoundSpan) {
|
|
452
455
|
const args = Position.toFileLocationRequestArgs(file, params.position);
|
|
453
456
|
const response = await this.tspClient.request(type, args);
|
|
454
457
|
if (response.type !== 'response' || !response.body) {
|
|
@@ -470,7 +473,7 @@ export class LspServer {
|
|
|
470
473
|
};
|
|
471
474
|
});
|
|
472
475
|
}
|
|
473
|
-
return this.getSymbolLocations({ type:
|
|
476
|
+
return this.getSymbolLocations({ type: CommandTypes.Definition, params });
|
|
474
477
|
}
|
|
475
478
|
async getSymbolLocations({ type, params }) {
|
|
476
479
|
const file = uriToPath(params.textDocument.uri);
|
|
@@ -491,7 +494,7 @@ export class LspServer {
|
|
|
491
494
|
if (!file) {
|
|
492
495
|
return [];
|
|
493
496
|
}
|
|
494
|
-
const response = await this.tspClient.request(
|
|
497
|
+
const response = await this.tspClient.request(CommandTypes.NavTree, {
|
|
495
498
|
file,
|
|
496
499
|
});
|
|
497
500
|
const tree = response.body;
|
|
@@ -532,7 +535,7 @@ export class LspServer {
|
|
|
532
535
|
}
|
|
533
536
|
const completionOptions = this.configurationManager.workspaceConfiguration.completions || {};
|
|
534
537
|
try {
|
|
535
|
-
const result = await this.interuptDiagnostics(() => this.tspClient.request(
|
|
538
|
+
const result = await this.interuptDiagnostics(() => this.tspClient.request(CommandTypes.CompletionInfo, {
|
|
536
539
|
file,
|
|
537
540
|
line: params.position.line + 1,
|
|
538
541
|
offset: params.position.character + 1,
|
|
@@ -570,7 +573,7 @@ export class LspServer {
|
|
|
570
573
|
async completionResolve(item) {
|
|
571
574
|
this.logger.log('completion/resolve', item);
|
|
572
575
|
await this.configurationManager.configureGloballyFromDocument(item.data.file);
|
|
573
|
-
const { body } = await this.interuptDiagnostics(() => this.tspClient.request(
|
|
576
|
+
const { body } = await this.interuptDiagnostics(() => this.tspClient.request(CommandTypes.CompletionDetails, item.data));
|
|
574
577
|
const details = body && body.length && body[0];
|
|
575
578
|
if (!details) {
|
|
576
579
|
return item;
|
|
@@ -600,7 +603,7 @@ export class LspServer {
|
|
|
600
603
|
}
|
|
601
604
|
async getQuickInfo(file, position) {
|
|
602
605
|
try {
|
|
603
|
-
return await this.tspClient.request(
|
|
606
|
+
return await this.tspClient.request(CommandTypes.Quickinfo, {
|
|
604
607
|
file,
|
|
605
608
|
line: position.line + 1,
|
|
606
609
|
offset: position.character + 1,
|
|
@@ -610,19 +613,30 @@ export class LspServer {
|
|
|
610
613
|
return undefined;
|
|
611
614
|
}
|
|
612
615
|
}
|
|
616
|
+
async prepareRename(params) {
|
|
617
|
+
const file = uriToPath(params.textDocument.uri);
|
|
618
|
+
if (!file) {
|
|
619
|
+
return null;
|
|
620
|
+
}
|
|
621
|
+
const result = await this.tspClient.request(CommandTypes.Rename, Position.toFileLocationRequestArgs(file, params.position));
|
|
622
|
+
const renameInfo = result.body?.info;
|
|
623
|
+
if (!renameInfo) {
|
|
624
|
+
return null;
|
|
625
|
+
}
|
|
626
|
+
if (!renameInfo.canRename) {
|
|
627
|
+
throw new Error(renameInfo.localizedErrorMessage);
|
|
628
|
+
}
|
|
629
|
+
return Range.fromTextSpan(renameInfo.triggerSpan);
|
|
630
|
+
}
|
|
613
631
|
async rename(params) {
|
|
614
632
|
const file = uriToPath(params.textDocument.uri);
|
|
615
633
|
this.logger.log('onRename', params, file);
|
|
616
634
|
if (!file) {
|
|
617
|
-
return
|
|
635
|
+
return null;
|
|
618
636
|
}
|
|
619
|
-
const result = await this.tspClient.request(
|
|
620
|
-
file,
|
|
621
|
-
line: params.position.line + 1,
|
|
622
|
-
offset: params.position.character + 1,
|
|
623
|
-
});
|
|
637
|
+
const result = await this.tspClient.request(CommandTypes.Rename, Position.toFileLocationRequestArgs(file, params.position));
|
|
624
638
|
if (!result.body || !result.body.info.canRename || result.body.locs.length === 0) {
|
|
625
|
-
return
|
|
639
|
+
return null;
|
|
626
640
|
}
|
|
627
641
|
const workspaceEdit = {};
|
|
628
642
|
result.body.locs
|
|
@@ -650,7 +664,7 @@ export class LspServer {
|
|
|
650
664
|
if (!file) {
|
|
651
665
|
return [];
|
|
652
666
|
}
|
|
653
|
-
const result = await this.tspClient.request(
|
|
667
|
+
const result = await this.tspClient.request(CommandTypes.References, {
|
|
654
668
|
file,
|
|
655
669
|
line: params.position.line + 1,
|
|
656
670
|
offset: params.position.character + 1,
|
|
@@ -670,7 +684,7 @@ export class LspServer {
|
|
|
670
684
|
}
|
|
671
685
|
const formatOptions = params.options;
|
|
672
686
|
await this.configurationManager.configureGloballyFromDocument(file, formatOptions);
|
|
673
|
-
const response = await this.tspClient.request(
|
|
687
|
+
const response = await this.tspClient.request(CommandTypes.Format, {
|
|
674
688
|
file,
|
|
675
689
|
line: 1,
|
|
676
690
|
offset: 1,
|
|
@@ -691,7 +705,7 @@ export class LspServer {
|
|
|
691
705
|
}
|
|
692
706
|
const formatOptions = params.options;
|
|
693
707
|
await this.configurationManager.configureGloballyFromDocument(file, formatOptions);
|
|
694
|
-
const response = await this.tspClient.request(
|
|
708
|
+
const response = await this.tspClient.request(CommandTypes.Format, {
|
|
695
709
|
file,
|
|
696
710
|
line: params.range.start.line + 1,
|
|
697
711
|
offset: params.range.start.character + 1,
|
|
@@ -719,7 +733,7 @@ export class LspServer {
|
|
|
719
733
|
async getSignatureHelp(file, params) {
|
|
720
734
|
try {
|
|
721
735
|
const { position, context } = params;
|
|
722
|
-
return await this.tspClient.request(
|
|
736
|
+
return await this.tspClient.request(CommandTypes.SignatureHelp, {
|
|
723
737
|
file,
|
|
724
738
|
line: position.line + 1,
|
|
725
739
|
offset: position.character + 1,
|
|
@@ -778,7 +792,7 @@ export class LspServer {
|
|
|
778
792
|
errorCodes,
|
|
779
793
|
};
|
|
780
794
|
try {
|
|
781
|
-
return await this.tspClient.request(
|
|
795
|
+
return await this.tspClient.request(CommandTypes.GetCodeFixes, args);
|
|
782
796
|
}
|
|
783
797
|
catch (err) {
|
|
784
798
|
return undefined;
|
|
@@ -791,7 +805,7 @@ export class LspServer {
|
|
|
791
805
|
kind: context.only?.length === 1 ? context.only[0] : undefined,
|
|
792
806
|
};
|
|
793
807
|
try {
|
|
794
|
-
return await this.tspClient.request(
|
|
808
|
+
return await this.tspClient.request(CommandTypes.GetApplicableRefactors, args);
|
|
795
809
|
}
|
|
796
810
|
catch (err) {
|
|
797
811
|
return undefined;
|
|
@@ -800,7 +814,7 @@ export class LspServer {
|
|
|
800
814
|
async getOrganizeImports(args) {
|
|
801
815
|
try {
|
|
802
816
|
await this.configurationManager.configureGloballyFromDocument(args.scope.args.file);
|
|
803
|
-
return await this.tspClient.request(
|
|
817
|
+
return await this.tspClient.request(CommandTypes.OrganizeImports, args);
|
|
804
818
|
}
|
|
805
819
|
catch (err) {
|
|
806
820
|
return undefined;
|
|
@@ -819,13 +833,13 @@ export class LspServer {
|
|
|
819
833
|
}
|
|
820
834
|
if (codeAction.commands && codeAction.commands.length) {
|
|
821
835
|
for (const command of codeAction.commands) {
|
|
822
|
-
await this.tspClient.request(
|
|
836
|
+
await this.tspClient.request(CommandTypes.ApplyCodeActionCommand, { command });
|
|
823
837
|
}
|
|
824
838
|
}
|
|
825
839
|
}
|
|
826
840
|
else if (arg.command === Commands.APPLY_REFACTORING && arg.arguments) {
|
|
827
841
|
const args = arg.arguments[0];
|
|
828
|
-
const { body } = await this.tspClient.request(
|
|
842
|
+
const { body } = await this.tspClient.request(CommandTypes.GetEditsForRefactor, args);
|
|
829
843
|
if (!body || !body.edits.length) {
|
|
830
844
|
return;
|
|
831
845
|
}
|
|
@@ -848,7 +862,7 @@ export class LspServer {
|
|
|
848
862
|
else if (arg.command === Commands.CONFIGURE_PLUGIN && arg.arguments) {
|
|
849
863
|
const [pluginName, configuration] = arg.arguments;
|
|
850
864
|
if (this.tspClient?.apiVersion.gte(API.v314)) {
|
|
851
|
-
this.tspClient.executeWithoutWaitingForResponse(
|
|
865
|
+
this.tspClient.executeWithoutWaitingForResponse(CommandTypes.ConfigurePlugin, {
|
|
852
866
|
configuration,
|
|
853
867
|
pluginName,
|
|
854
868
|
});
|
|
@@ -858,7 +872,7 @@ export class LspServer {
|
|
|
858
872
|
const file = arg.arguments[0];
|
|
859
873
|
const additionalArguments = arg.arguments[1] || {};
|
|
860
874
|
await this.configurationManager.configureGloballyFromDocument(file);
|
|
861
|
-
const { body } = await this.tspClient.request(
|
|
875
|
+
const { body } = await this.tspClient.request(CommandTypes.OrganizeImports, {
|
|
862
876
|
scope: {
|
|
863
877
|
type: 'file',
|
|
864
878
|
args: { file },
|
|
@@ -877,7 +891,7 @@ export class LspServer {
|
|
|
877
891
|
await this.applyFileCodeEdits(codeAction.changes);
|
|
878
892
|
if (codeAction.commands && codeAction.commands.length) {
|
|
879
893
|
for (const command of codeAction.commands) {
|
|
880
|
-
await this.tspClient.request(
|
|
894
|
+
await this.tspClient.request(CommandTypes.ApplyCodeActionCommand, { command });
|
|
881
895
|
}
|
|
882
896
|
}
|
|
883
897
|
// Execute only the first code action.
|
|
@@ -917,7 +931,7 @@ export class LspServer {
|
|
|
917
931
|
return [];
|
|
918
932
|
}
|
|
919
933
|
try {
|
|
920
|
-
const { body } = await this.tspClient.request(
|
|
934
|
+
const { body } = await this.tspClient.request(CommandTypes.GetEditsForFileRename, {
|
|
921
935
|
oldFilePath,
|
|
922
936
|
newFilePath,
|
|
923
937
|
});
|
|
@@ -935,7 +949,7 @@ export class LspServer {
|
|
|
935
949
|
}
|
|
936
950
|
let response;
|
|
937
951
|
try {
|
|
938
|
-
response = await this.tspClient.request(
|
|
952
|
+
response = await this.tspClient.request(CommandTypes.DocumentHighlights, {
|
|
939
953
|
file,
|
|
940
954
|
line: arg.position.line + 1,
|
|
941
955
|
offset: arg.position.character + 1,
|
|
@@ -963,7 +977,7 @@ export class LspServer {
|
|
|
963
977
|
return this.documents.files[0] || this.workspaceRoot;
|
|
964
978
|
}
|
|
965
979
|
async workspaceSymbol(params) {
|
|
966
|
-
const result = await this.tspClient.request(
|
|
980
|
+
const result = await this.tspClient.request(CommandTypes.Navto, {
|
|
967
981
|
file: this.lastFileOrDummy(),
|
|
968
982
|
searchValue: params.query,
|
|
969
983
|
});
|
|
@@ -997,7 +1011,7 @@ export class LspServer {
|
|
|
997
1011
|
if (!document) {
|
|
998
1012
|
throw new Error("The document should be opened for foldingRanges', file: " + file);
|
|
999
1013
|
}
|
|
1000
|
-
const { body } = await this.tspClient.request(
|
|
1014
|
+
const { body } = await this.tspClient.request(CommandTypes.GetOutliningSpans, { file });
|
|
1001
1015
|
if (!body) {
|
|
1002
1016
|
return undefined;
|
|
1003
1017
|
}
|
|
@@ -1086,7 +1100,7 @@ export class LspServer {
|
|
|
1086
1100
|
character: 0,
|
|
1087
1101
|
});
|
|
1088
1102
|
try {
|
|
1089
|
-
const result = await this.tspClient.request(
|
|
1103
|
+
const result = await this.tspClient.request(CommandTypes.ProvideInlayHints, {
|
|
1090
1104
|
file,
|
|
1091
1105
|
start: start,
|
|
1092
1106
|
length: end - start,
|
|
@@ -1143,7 +1157,7 @@ export class LspServer {
|
|
|
1143
1157
|
}
|
|
1144
1158
|
async getSemanticTokens(doc, file, startOffset, endOffset) {
|
|
1145
1159
|
try {
|
|
1146
|
-
const result = await this.tspClient.request(
|
|
1160
|
+
const result = await this.tspClient.request(CommandTypes.EncodedSemanticClassificationsFull, {
|
|
1147
1161
|
file,
|
|
1148
1162
|
start: startOffset,
|
|
1149
1163
|
length: endOffset - startOffset,
|