typescript-language-server 1.0.0 → 1.1.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.
Files changed (95) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/README.md +128 -21
  3. package/lib/calls.d.ts +1 -1
  4. package/lib/calls.d.ts.map +1 -1
  5. package/lib/calls.js +140 -164
  6. package/lib/calls.js.map +1 -1
  7. package/lib/cli.js +1 -1
  8. package/lib/commands.d.ts +1 -0
  9. package/lib/commands.d.ts.map +1 -1
  10. package/lib/commands.js +3 -1
  11. package/lib/commands.js.map +1 -1
  12. package/lib/completion.d.ts +4 -7
  13. package/lib/completion.d.ts.map +1 -1
  14. package/lib/completion.js +64 -66
  15. package/lib/completion.js.map +1 -1
  16. package/lib/configuration-manager.d.ts +47 -0
  17. package/lib/configuration-manager.d.ts.map +1 -0
  18. package/lib/configuration-manager.js +105 -0
  19. package/lib/configuration-manager.js.map +1 -0
  20. package/lib/diagnostic-queue.d.ts +5 -4
  21. package/lib/diagnostic-queue.d.ts.map +1 -1
  22. package/lib/diagnostic-queue.js +7 -8
  23. package/lib/diagnostic-queue.js.map +1 -1
  24. package/lib/document-symbol.d.ts.map +1 -1
  25. package/lib/document-symbol.js +11 -10
  26. package/lib/document-symbol.js.map +1 -1
  27. package/lib/features/fix-all.d.ts.map +1 -1
  28. package/lib/features/fix-all.js +96 -112
  29. package/lib/features/fix-all.js.map +1 -1
  30. package/lib/features/inlay-hints.d.ts +11 -0
  31. package/lib/features/inlay-hints.d.ts.map +1 -0
  32. package/lib/features/inlay-hints.js +70 -0
  33. package/lib/features/inlay-hints.js.map +1 -0
  34. package/lib/features/source-definition.d.ts +11 -0
  35. package/lib/features/source-definition.d.ts.map +1 -0
  36. package/lib/features/source-definition.js +50 -0
  37. package/lib/features/source-definition.js.map +1 -0
  38. package/lib/file-lsp-server.spec.js +16 -25
  39. package/lib/file-lsp-server.spec.js.map +1 -1
  40. package/lib/hover.d.ts +2 -1
  41. package/lib/hover.d.ts.map +1 -1
  42. package/lib/hover.js +47 -7
  43. package/lib/hover.js.map +1 -1
  44. package/lib/logger.js +1 -1
  45. package/lib/logger.js.map +1 -1
  46. package/lib/lsp-client.d.ts +11 -15
  47. package/lib/lsp-client.d.ts.map +1 -1
  48. package/lib/lsp-client.js +29 -61
  49. package/lib/lsp-client.js.map +1 -1
  50. package/lib/lsp-connection.d.ts.map +1 -1
  51. package/lib/lsp-connection.js +3 -2
  52. package/lib/lsp-connection.js.map +1 -1
  53. package/lib/lsp-protocol.inlayHints.proposed.d.ts +0 -9
  54. package/lib/lsp-protocol.inlayHints.proposed.d.ts.map +1 -1
  55. package/lib/lsp-server.d.ts +15 -20
  56. package/lib/lsp-server.d.ts.map +1 -1
  57. package/lib/lsp-server.js +807 -901
  58. package/lib/lsp-server.js.map +1 -1
  59. package/lib/lsp-server.spec.js +772 -495
  60. package/lib/lsp-server.spec.js.map +1 -1
  61. package/lib/organize-imports.spec.js +8 -8
  62. package/lib/protocol-translation.d.ts +2 -7
  63. package/lib/protocol-translation.d.ts.map +1 -1
  64. package/lib/protocol-translation.js +19 -106
  65. package/lib/protocol-translation.js.map +1 -1
  66. package/lib/quickfix.js +1 -1
  67. package/lib/refactor.js +5 -1
  68. package/lib/refactor.js.map +1 -1
  69. package/lib/test-utils.d.ts +4 -3
  70. package/lib/test-utils.d.ts.map +1 -1
  71. package/lib/test-utils.js +103 -77
  72. package/lib/test-utils.js.map +1 -1
  73. package/lib/ts-protocol.d.ts +4 -19
  74. package/lib/ts-protocol.d.ts.map +1 -1
  75. package/lib/ts-protocol.js.map +1 -1
  76. package/lib/tsp-client.d.ts +36 -32
  77. package/lib/tsp-client.d.ts.map +1 -1
  78. package/lib/tsp-client.js +9 -7
  79. package/lib/tsp-client.js.map +1 -1
  80. package/lib/tsp-client.spec.js +26 -33
  81. package/lib/tsp-client.spec.js.map +1 -1
  82. package/lib/tsp-command-types.d.ts +1 -0
  83. package/lib/tsp-command-types.d.ts.map +1 -1
  84. package/lib/tsp-command-types.js +1 -1
  85. package/lib/tsp-command-types.js.map +1 -1
  86. package/lib/utils/typeConverters.d.ts +19 -1
  87. package/lib/utils/typeConverters.d.ts.map +1 -1
  88. package/lib/utils/typeConverters.js +103 -4
  89. package/lib/utils/typeConverters.js.map +1 -1
  90. package/lib/utils/versionProvider.js +17 -19
  91. package/lib/utils/versionProvider.js.map +1 -1
  92. package/lib/utils.d.ts.map +1 -1
  93. package/lib/utils.js +2 -0
  94. package/lib/utils.js.map +1 -1
  95. package/package.json +10 -7
package/CHANGELOG.md CHANGED
@@ -1,6 +1,37 @@
1
1
  # Changelog
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
+ ## [1.1.2](https://github.com/typescript-language-server/typescript-language-server/compare/v1.1.1...v1.1.2) (2022-08-25)
5
+
6
+
7
+ ### Bug Fixes
8
+
9
+ * definition request crashing on getting span ([#574](https://github.com/typescript-language-server/typescript-language-server/issues/574)) ([4e1c82b](https://github.com/typescript-language-server/typescript-language-server/commit/4e1c82b82878316a12ff6b524d7dd5ab54b86acd))
10
+
11
+ ## [1.1.1](https://github.com/typescript-language-server/typescript-language-server/compare/v1.1.0...v1.1.1) (2022-08-22)
12
+
13
+
14
+ ### Bug Fixes
15
+
16
+ * move deepmerge to dependencies ([06109d4](https://github.com/typescript-language-server/typescript-language-server/commit/06109d4646d94bdf1bbeb2768e18f1323ae1b630))
17
+
18
+ ## [1.1.0](https://github.com/typescript-language-server/typescript-language-server/compare/v1.0.0...v1.1.0) (2022-08-21)
19
+
20
+
21
+ ### Features
22
+
23
+ * add "Go To Source Definition" command ([#560](https://github.com/typescript-language-server/typescript-language-server/issues/560)) ([9bcdaf2](https://github.com/typescript-language-server/typescript-language-server/commit/9bcdaf2b0b09da9aa4d7e6ed79bdcd742b3cfc17))
24
+ * support `textDocument/inlayHint` request from 3.17.0 spec ([#566](https://github.com/typescript-language-server/typescript-language-server/issues/566)) ([9a2fd4e](https://github.com/typescript-language-server/typescript-language-server/commit/9a2fd4e34b6c50c57b974f617018dcefdb469788))
25
+ * support LocationLink[] for textDocument/definition response ([#563](https://github.com/typescript-language-server/typescript-language-server/issues/563)) ([196f328](https://github.com/typescript-language-server/typescript-language-server/commit/196f328cd9fd7a06998151d59bed0b945cc68b40))
26
+
27
+
28
+ ### Bug Fixes
29
+
30
+ * don't trigger error on empty Source Definition response ([#568](https://github.com/typescript-language-server/typescript-language-server/issues/568)) ([146a6ba](https://github.com/typescript-language-server/typescript-language-server/commit/146a6ba97f0792701ff8afcc431d3a1dfdb978a6))
31
+ * make wording in the typescript lookup error more generic ([585a05e](https://github.com/typescript-language-server/typescript-language-server/commit/585a05e43a0b530f10e488aed634fac0436109ae)), closes [#554](https://github.com/typescript-language-server/typescript-language-server/issues/554)
32
+ * snippet completions returned to clients that don't support them ([#556](https://github.com/typescript-language-server/typescript-language-server/issues/556)) ([050d335](https://github.com/typescript-language-server/typescript-language-server/commit/050d3350e16fe78b7c60d7443ed3ad6d2cc4730d))
33
+ * update signature help feature to v3.15.0 LSP spec ([#555](https://github.com/typescript-language-server/typescript-language-server/issues/555)) ([da074a6](https://github.com/typescript-language-server/typescript-language-server/commit/da074a618ca6c29819834a0344682094d6ff08f6))
34
+
4
35
  ## [1.0.0](https://github.com/typescript-language-server/typescript-language-server/compare/v0.11.2...v1.0.0) (2022-08-06)
5
36
 
6
37
 
package/README.md CHANGED
@@ -11,6 +11,33 @@ Based on concepts and ideas from https://github.com/prabirshrestha/typescript-la
11
11
 
12
12
  Maintained by a [community of contributors](https://github.com/typescript-language-server/typescript-language-server/graphs/contributors) like you
13
13
 
14
+ <!-- MarkdownTOC -->
15
+
16
+ - [Installing](#installing)
17
+ - [Running the language server](#running-the-language-server)
18
+ - [CLI Options](#cli-options)
19
+ - [initializationOptions](#initializationoptions)
20
+ - [workspace/didChangeConfiguration](#workspacedidchangeconfiguration)
21
+ - [Code actions on save](#code-actions-on-save)
22
+ - [Workspace commands \(`workspace/executeCommand`\)](#workspace-commands-workspaceexecutecommand)
23
+ - [Go to Source Definition](#go-to-source-definition)
24
+ - [Apply Workspace Edits](#apply-workspace-edits)
25
+ - [Apply Code Action](#apply-code-action)
26
+ - [Apply Refactoring](#apply-refactoring)
27
+ - [Organize Imports](#organize-imports)
28
+ - [Rename File](#rename-file)
29
+ - [Inlay hints \(`typescript/inlayHints`\) \(experimental\)](#inlay-hints-typescriptinlayhints-experimental)
30
+ - [Callers and callees \(`textDocument/calls`\) \(experimental\)](#callers-and-callees-textdocumentcalls-experimental)
31
+ - [Supported Protocol features](#supported-protocol-features)
32
+ - [Experimental](#experimental)
33
+ - [Development](#development)
34
+ - [Build](#build)
35
+ - [Test](#test)
36
+ - [Watch](#watch)
37
+ - [Publishing](#publishing)
38
+
39
+ <!-- /MarkdownTOC -->
40
+
14
41
  ## Installing
15
42
 
16
43
  ```sh
@@ -247,38 +274,114 @@ The user can enable it with a setting similar to (can vary per-editor):
247
274
 
248
275
  ## Workspace commands (`workspace/executeCommand`)
249
276
 
250
- See [LSP specification](https://microsoft.github.io/language-server-protocol/specifications/specification-3-17/#workspace_executeCommand).
277
+ See [LSP specification](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#workspace_executeCommand).
251
278
 
252
279
  Most of the time, you'll execute commands with arguments retrieved from another request like `textDocument/codeAction`. There are some use cases for calling them manually.
253
280
 
254
- Supported commands:
281
+ `lsp` refers to the language server protocol types, `tsp` refers to the typescript server protocol types.
282
+
283
+ ### Go to Source Definition
284
+
285
+ - Request:
286
+ ```ts
287
+ {
288
+ command: `_typescript.goToSourceDefinition`
289
+ arguments: [
290
+ lsp.DocumentUri, // String URI of the document
291
+ lsp.Position, // Line and character position (zero-based)
292
+ ]
293
+ }
294
+ ```
295
+ - Response:
296
+ ```ts
297
+ lsp.Location[] | null
298
+ ```
299
+
300
+ (This command is supported from Typescript 4.7.)
301
+
302
+ ### Apply Workspace Edits
303
+
304
+ - Request:
305
+ ```ts
306
+ {
307
+ command: `_typescript.applyWorkspaceEdit`
308
+ arguments: [lsp.WorkspaceEdit]
309
+ }
310
+ ```
311
+ - Response:
312
+ ```ts
313
+ lsp.ApplyWorkspaceEditResult
314
+ ```
255
315
 
256
- `lsp` refers to the language server protocol, `tsp` refers to the typescript server protocol.
316
+ ### Apply Code Action
257
317
 
258
- * `_typescript.applyWorkspaceEdit`
318
+ - Request:
319
+ ```ts
320
+ {
321
+ command: `_typescript.applyCodeAction`
322
+ arguments: [
323
+ tsp.CodeAction, // TypeScript Code Action object
324
+ ]
325
+ }
326
+ ```
327
+ - Response:
259
328
  ```ts
260
- type Arguments = [lsp.WorkspaceEdit]
329
+ void
261
330
  ```
262
- * `_typescript.applyCodeAction`
331
+
332
+ ### Apply Refactoring
333
+
334
+ - Request:
263
335
  ```ts
264
- type Arguments = [tsp.CodeAction]
336
+ {
337
+ command: `_typescript.applyRefactoring`
338
+ arguments: [
339
+ tsp.GetEditsForRefactorRequestArgs,
340
+ ]
341
+ }
265
342
  ```
266
- * `_typescript.applyRefactoring`
343
+ - Response:
267
344
  ```ts
268
- type Arguments = [tsp.GetEditsForRefactorRequestArgs]
345
+ void
269
346
  ```
270
- * `_typescript.organizeImports`
347
+
348
+ ### Organize Imports
349
+
350
+ - Request:
271
351
  ```ts
272
- // The "skipDestructiveCodeActions" argument is supported from Typescript 4.4+
273
- type Arguments = [string] | [string, { skipDestructiveCodeActions?: boolean }]
352
+ {
353
+ command: `_typescript.organizeImports`
354
+ arguments: [
355
+ // The "skipDestructiveCodeActions" argument is supported from Typescript 4.4+
356
+ [string] | [string, { skipDestructiveCodeActions?: boolean }],
357
+ ]
358
+ }
274
359
  ```
275
- * `_typescript.applyRenameFile`
360
+ - Response:
276
361
  ```ts
277
- type Arguments = [{ sourceUri: string; targetUri: string; }]
362
+ void
363
+ ```
364
+
365
+ ### Rename File
366
+
367
+ - Request:
368
+ ```ts
369
+ {
370
+ command: `_typescript.applyRenameFile`
371
+ arguments: [
372
+ { sourceUri: string; targetUri: string; },
373
+ ]
374
+ }
375
+ ```
376
+ - Response:
377
+ ```ts
378
+ void
278
379
  ```
279
380
 
280
381
  ## Inlay hints (`typescript/inlayHints`) (experimental)
281
382
 
383
+ > !!! This implementation is deprecated. Use the spec-compliant `textDocument/inlayHint` request instead. !!!
384
+
282
385
  Supports experimental inline hints.
283
386
 
284
387
  ```ts
@@ -401,28 +504,32 @@ interface DefinitionSymbol {
401
504
 
402
505
  ## Supported Protocol features
403
506
 
507
+ - [x] textDocument/codeAction
508
+ - [x] textDocument/completion (incl. `completion/resolve`)
509
+ - [x] textDocument/definition
404
510
  - [x] textDocument/didChange (incremental)
405
511
  - [x] textDocument/didClose
406
512
  - [x] textDocument/didOpen
407
513
  - [x] textDocument/didSave
408
- - [x] textDocument/codeAction
409
- - [x] textDocument/completion (incl. completion/resolve)
410
- - [x] textDocument/definition
411
514
  - [x] textDocument/documentHighlight
412
515
  - [x] textDocument/documentSymbol
413
516
  - [x] textDocument/executeCommand
414
517
  - [x] textDocument/formatting
415
- - [x] textDocument/rangeFormatting
416
518
  - [x] textDocument/hover
417
- - [x] textDocument/rename
519
+ - [x] textDocument/inlayHint (no support for `inlayHint/resolve` or `workspace/inlayHint/refresh`)
520
+ - [x] textDocument/rangeFormatting
418
521
  - [x] textDocument/references
522
+ - [x] textDocument/rename
419
523
  - [x] textDocument/signatureHelp
420
- - [x] textDocument/calls (experimental)
421
- - [x] typescript/inlayHints (experimental, supported from Typescript v4.4.2)
422
524
  - [x] workspace/symbol
423
525
  - [x] workspace/didChangeConfiguration
424
526
  - [x] workspace/executeCommand
425
527
 
528
+ ### Experimental
529
+
530
+ - [x] textDocument/calls (experimental)
531
+ - [x] typescript/inlayHints (experimental, supported from Typescript v4.4.2) DEPRECATED (use `textDocument/inlayHint` instead)
532
+
426
533
  ## Development
427
534
 
428
535
  ### Build
package/lib/calls.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as lsp from 'vscode-languageserver';
2
+ import { TextDocument } from 'vscode-languageserver-textdocument';
2
3
  import * as lspcalls from './lsp-protocol.calls.proposed.js';
3
4
  import { TspClient } from './tsp-client.js';
4
- import { TextDocument } from 'vscode-languageserver-textdocument';
5
5
  export declare function computeCallers(tspClient: TspClient, args: lsp.TextDocumentPositionParams): Promise<lspcalls.CallsResult>;
6
6
  export declare type DocumentProvider = (file: string) => TextDocument | undefined;
7
7
  export declare function computeCallees(tspClient: TspClient, args: lsp.TextDocumentPositionParams, documentProvider: DocumentProvider): Promise<lspcalls.CallsResult>;
@@ -1 +1 @@
1
- {"version":3,"file":"calls.d.ts","sourceRoot":"","sources":["../src/calls.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,GAAG,MAAM,uBAAuB,CAAC;AAC7C,OAAO,KAAK,QAAQ,MAAM,kCAAkC,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAG5C,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAElE,wBAAsB,cAAc,CAAC,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,CAAC,0BAA0B,GAAG,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CAwB9H;AACD,oBAAY,gBAAgB,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,YAAY,GAAG,SAAS,CAAC;AAC1E,wBAAsB,cAAc,CAAC,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,CAAC,0BAA0B,EAAE,gBAAgB,EAAE,gBAAgB,GAAG,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CA6BlK"}
1
+ {"version":3,"file":"calls.d.ts","sourceRoot":"","sources":["../src/calls.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,GAAG,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAClE,OAAO,KAAK,QAAQ,MAAM,kCAAkC,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAK5C,wBAAsB,cAAc,CAAC,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,CAAC,0BAA0B,GAAG,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CAwB9H;AACD,oBAAY,gBAAgB,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,YAAY,GAAG,SAAS,CAAC;AAC1E,wBAAsB,cAAc,CAAC,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,CAAC,0BAA0B,EAAE,gBAAgB,EAAE,gBAAgB,GAAG,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CA6BlK"}
package/lib/calls.js CHANGED
@@ -1,161 +1,143 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
1
  import * as lsp from 'vscode-languageserver';
11
2
  import * as lspcalls from './lsp-protocol.calls.proposed.js';
12
- import { uriToPath, toLocation, asRange, Range, toSymbolKind, pathToUri } from './protocol-translation.js';
13
- export function computeCallers(tspClient, args) {
14
- return __awaiter(this, void 0, void 0, function* () {
15
- const nullResult = { calls: [] };
16
- const contextDefinition = yield getDefinition(tspClient, args);
17
- if (!contextDefinition) {
18
- return nullResult;
19
- }
20
- const contextSymbol = yield findEnclosingSymbol(tspClient, contextDefinition);
21
- if (!contextSymbol) {
22
- return nullResult;
23
- }
24
- const callerReferences = yield findNonDefinitionReferences(tspClient, contextDefinition);
25
- const calls = [];
26
- for (const callerReference of callerReferences) {
27
- const symbol = yield findEnclosingSymbol(tspClient, callerReference);
28
- if (!symbol) {
29
- continue;
30
- }
31
- const location = toLocation(callerReference, undefined);
32
- calls.push({
33
- location,
34
- symbol
35
- });
3
+ import { uriToPath, toLocation, toSymbolKind, pathToUri } from './protocol-translation.js';
4
+ import { Range } from './utils/typeConverters.js';
5
+ export async function computeCallers(tspClient, args) {
6
+ const nullResult = { calls: [] };
7
+ const contextDefinition = await getDefinition(tspClient, args);
8
+ if (!contextDefinition) {
9
+ return nullResult;
10
+ }
11
+ const contextSymbol = await findEnclosingSymbol(tspClient, contextDefinition);
12
+ if (!contextSymbol) {
13
+ return nullResult;
14
+ }
15
+ const callerReferences = await findNonDefinitionReferences(tspClient, contextDefinition);
16
+ const calls = [];
17
+ for (const callerReference of callerReferences) {
18
+ const symbol = await findEnclosingSymbol(tspClient, callerReference);
19
+ if (!symbol) {
20
+ continue;
36
21
  }
37
- return { calls, symbol: contextSymbol };
38
- });
22
+ const location = toLocation(callerReference, undefined);
23
+ calls.push({
24
+ location,
25
+ symbol,
26
+ });
27
+ }
28
+ return { calls, symbol: contextSymbol };
39
29
  }
40
- export function computeCallees(tspClient, args, documentProvider) {
41
- return __awaiter(this, void 0, void 0, function* () {
42
- const nullResult = { calls: [] };
43
- const contextDefinition = yield getDefinition(tspClient, args);
44
- if (!contextDefinition) {
45
- return nullResult;
46
- }
47
- const contextSymbol = yield findEnclosingSymbol(tspClient, contextDefinition);
48
- if (!contextSymbol) {
49
- return nullResult;
30
+ export async function computeCallees(tspClient, args, documentProvider) {
31
+ const nullResult = { calls: [] };
32
+ const contextDefinition = await getDefinition(tspClient, args);
33
+ if (!contextDefinition) {
34
+ return nullResult;
35
+ }
36
+ const contextSymbol = await findEnclosingSymbol(tspClient, contextDefinition);
37
+ if (!contextSymbol) {
38
+ return nullResult;
39
+ }
40
+ const outgoingCallReferences = await findOutgoingCalls(tspClient, contextSymbol, documentProvider);
41
+ const calls = [];
42
+ for (const reference of outgoingCallReferences) {
43
+ const definitionReferences = await findDefinitionReferences(tspClient, reference);
44
+ const definitionReference = definitionReferences[0];
45
+ if (!definitionReference) {
46
+ continue;
50
47
  }
51
- const outgoingCallReferences = yield findOutgoingCalls(tspClient, contextSymbol, documentProvider);
52
- const calls = [];
53
- for (const reference of outgoingCallReferences) {
54
- const definitionReferences = yield findDefinitionReferences(tspClient, reference);
55
- const definitionReference = definitionReferences[0];
56
- if (!definitionReference) {
57
- continue;
58
- }
59
- const definitionSymbol = yield findEnclosingSymbol(tspClient, definitionReference);
60
- if (!definitionSymbol) {
61
- continue;
62
- }
63
- const location = toLocation(reference, undefined);
64
- calls.push({
65
- location,
66
- symbol: definitionSymbol
67
- });
48
+ const definitionSymbol = await findEnclosingSymbol(tspClient, definitionReference);
49
+ if (!definitionSymbol) {
50
+ continue;
68
51
  }
69
- return { calls, symbol: contextSymbol };
70
- });
52
+ const location = toLocation(reference, undefined);
53
+ calls.push({
54
+ location,
55
+ symbol: definitionSymbol,
56
+ });
57
+ }
58
+ return { calls, symbol: contextSymbol };
71
59
  }
72
- function findOutgoingCalls(tspClient, contextSymbol, documentProvider) {
73
- return __awaiter(this, void 0, void 0, function* () {
74
- /**
75
- * The TSP does not provide call references.
76
- * As long as we are not able to access the AST in a tsserver plugin and return the information necessary as metadata to the reponse,
77
- * we need to test possible calls.
78
- */
79
- const computeCallCandidates = (document, range) => {
80
- const symbolText = document.getText(range);
81
- const regex = /\W([$_a-zA-Z0-9\u{00C0}-\u{E007F}]+)(<.*>)?\(/gmu; // Example: matches `candidate` in " candidate()", "Foo.candidate<T>()", etc.
82
- let match = regex.exec(symbolText);
83
- const candidates = [];
84
- while (match) {
85
- const identifier = match[1];
86
- if (identifier) {
87
- const start = match.index + match[0].indexOf(identifier);
88
- const end = start + identifier.length;
89
- candidates.push({ identifier, start, end });
90
- }
91
- match = regex.exec(symbolText);
60
+ async function findOutgoingCalls(tspClient, contextSymbol, documentProvider) {
61
+ /**
62
+ * The TSP does not provide call references.
63
+ * As long as we are not able to access the AST in a tsserver plugin and return the information necessary as metadata to the reponse,
64
+ * we need to test possible calls.
65
+ */
66
+ const computeCallCandidates = (document, range) => {
67
+ const symbolText = document.getText(range);
68
+ const regex = /\W([$_a-zA-Z0-9\u{00C0}-\u{E007F}]+)(<.*>)?\(/gmu; // Example: matches `candidate` in " candidate()", "Foo.candidate<T>()", etc.
69
+ let match = regex.exec(symbolText);
70
+ const candidates = [];
71
+ while (match) {
72
+ const identifier = match[1];
73
+ if (identifier) {
74
+ const start = match.index + match[0].indexOf(identifier);
75
+ const end = start + identifier.length;
76
+ candidates.push({ identifier, start, end });
92
77
  }
93
- const offset = document.offsetAt(range.start);
94
- const candidateRanges = candidates.map(c => lsp.Range.create(document.positionAt(offset + c.start), document.positionAt(offset + c.end)));
95
- return candidateRanges;
96
- };
97
- /**
98
- * This function tests a candidate and returns a locaion for a valid call.
99
- */
100
- const validateCall = (file, candidateRange) => __awaiter(this, void 0, void 0, function* () {
101
- const tspPosition = { line: candidateRange.start.line + 1, offset: candidateRange.start.character + 1 };
102
- const references = yield findNonDefinitionReferences(tspClient, { file, start: tspPosition, end: tspPosition });
103
- for (const reference of references) {
104
- const tspPosition = { line: candidateRange.start.line + 1, offset: candidateRange.start.character + 1 };
105
- if (tspPosition.line === reference.start.line) {
106
- return reference;
107
- }
108
- }
109
- });
110
- const calls = [];
111
- const file = uriToPath(contextSymbol.location.uri);
112
- const document = documentProvider(file);
113
- if (!document) {
114
- return calls;
78
+ match = regex.exec(symbolText);
115
79
  }
116
- const candidateRanges = computeCallCandidates(document, contextSymbol.location.range);
117
- for (const candidateRange of candidateRanges) {
118
- const call = yield validateCall(file, candidateRange);
119
- if (call) {
120
- calls.push(call);
80
+ const offset = document.offsetAt(range.start);
81
+ const candidateRanges = candidates.map(c => lsp.Range.create(document.positionAt(offset + c.start), document.positionAt(offset + c.end)));
82
+ return candidateRanges;
83
+ };
84
+ /**
85
+ * This function tests a candidate and returns a locaion for a valid call.
86
+ */
87
+ const validateCall = async (file, candidateRange) => {
88
+ const tspPosition = { line: candidateRange.start.line + 1, offset: candidateRange.start.character + 1 };
89
+ const references = await findNonDefinitionReferences(tspClient, { file, start: tspPosition, end: tspPosition });
90
+ for (const reference of references) {
91
+ const tspPosition = { line: candidateRange.start.line + 1, offset: candidateRange.start.character + 1 };
92
+ if (tspPosition.line === reference.start.line) {
93
+ return reference;
121
94
  }
122
95
  }
96
+ };
97
+ const calls = [];
98
+ const file = uriToPath(contextSymbol.location.uri);
99
+ const document = documentProvider(file);
100
+ if (!document) {
123
101
  return calls;
124
- });
125
- }
126
- function getDefinition(tspClient, args) {
127
- return __awaiter(this, void 0, void 0, function* () {
128
- const file = uriToPath(args.textDocument.uri);
129
- if (!file) {
130
- return undefined;
102
+ }
103
+ const candidateRanges = computeCallCandidates(document, contextSymbol.location.range);
104
+ for (const candidateRange of candidateRanges) {
105
+ const call = await validateCall(file, candidateRange);
106
+ if (call) {
107
+ calls.push(call);
131
108
  }
132
- const definitionResult = yield tspClient.request("definition" /* CommandTypes.Definition */, {
133
- file,
134
- line: args.position.line + 1,
135
- offset: args.position.character + 1
136
- });
137
- return definitionResult.body ? definitionResult.body[0] : undefined;
138
- });
109
+ }
110
+ return calls;
139
111
  }
140
- function findEnclosingSymbol(tspClient, args) {
141
- return __awaiter(this, void 0, void 0, function* () {
142
- const file = args.file;
143
- const response = yield tspClient.request("navtree" /* CommandTypes.NavTree */, { file });
144
- const tree = response.body;
145
- if (!tree || !tree.childItems) {
146
- return undefined;
147
- }
148
- const pos = lsp.Position.create(args.start.line - 1, args.start.offset - 1);
149
- const symbol = yield findEnclosingSymbolInTree(tree, lsp.Range.create(pos, pos));
150
- if (!symbol) {
151
- return undefined;
152
- }
153
- const uri = pathToUri(file, undefined);
154
- return lspcalls.DefinitionSymbol.create(uri, symbol);
112
+ async function getDefinition(tspClient, args) {
113
+ const file = uriToPath(args.textDocument.uri);
114
+ if (!file) {
115
+ return undefined;
116
+ }
117
+ const definitionResult = await tspClient.request("definition" /* CommandTypes.Definition */, {
118
+ file,
119
+ line: args.position.line + 1,
120
+ offset: args.position.character + 1,
155
121
  });
122
+ return definitionResult.body ? definitionResult.body[0] : undefined;
123
+ }
124
+ async function findEnclosingSymbol(tspClient, args) {
125
+ const file = args.file;
126
+ const response = await tspClient.request("navtree" /* CommandTypes.NavTree */, { file });
127
+ const tree = response.body;
128
+ if (!tree || !tree.childItems) {
129
+ return undefined;
130
+ }
131
+ const pos = lsp.Position.create(args.start.line - 1, args.start.offset - 1);
132
+ const symbol = findEnclosingSymbolInTree(tree, lsp.Range.create(pos, pos));
133
+ if (!symbol) {
134
+ return undefined;
135
+ }
136
+ const uri = pathToUri(file, undefined);
137
+ return lspcalls.DefinitionSymbol.create(uri, symbol);
156
138
  }
157
139
  function findEnclosingSymbolInTree(parent, range) {
158
- const inSpan = (span) => !!Range.intersection(asRange(span), range);
140
+ const inSpan = (span) => !!Range.intersection(Range.fromTextSpan(span), range);
159
141
  const inTree = (tree) => tree.spans.some(span => inSpan(span));
160
142
  let candidate = inTree(parent) ? parent : undefined;
161
143
  outer: while (candidate) {
@@ -172,10 +154,10 @@ function findEnclosingSymbolInTree(parent, range) {
172
154
  return undefined;
173
155
  }
174
156
  const span = candidate.spans.find(span => inSpan(span));
175
- const spanRange = asRange(span);
157
+ const spanRange = Range.fromTextSpan(span);
176
158
  let selectionRange = spanRange;
177
159
  if (candidate.nameSpan) {
178
- const nameRange = asRange(candidate.nameSpan);
160
+ const nameRange = Range.fromTextSpan(candidate.nameSpan);
179
161
  if (Range.intersection(spanRange, nameRange)) {
180
162
  selectionRange = nameRange;
181
163
  }
@@ -184,31 +166,25 @@ function findEnclosingSymbolInTree(parent, range) {
184
166
  name: candidate.text,
185
167
  kind: toSymbolKind(candidate.kind),
186
168
  range: spanRange,
187
- selectionRange: selectionRange
169
+ selectionRange: selectionRange,
188
170
  };
189
171
  }
190
- function findDefinitionReferences(tspClient, args) {
191
- return __awaiter(this, void 0, void 0, function* () {
192
- return (yield findReferences(tspClient, args)).filter(ref => ref.isDefinition);
193
- });
172
+ async function findDefinitionReferences(tspClient, args) {
173
+ return (await findReferences(tspClient, args)).filter(ref => ref.isDefinition);
194
174
  }
195
- function findNonDefinitionReferences(tspClient, args) {
196
- return __awaiter(this, void 0, void 0, function* () {
197
- return (yield findReferences(tspClient, args)).filter(ref => !ref.isDefinition);
198
- });
175
+ async function findNonDefinitionReferences(tspClient, args) {
176
+ return (await findReferences(tspClient, args)).filter(ref => !ref.isDefinition);
199
177
  }
200
- function findReferences(tspClient, args) {
201
- return __awaiter(this, void 0, void 0, function* () {
202
- const file = args.file;
203
- const result = yield tspClient.request("references" /* CommandTypes.References */, {
204
- file,
205
- line: args.start.line,
206
- offset: args.start.offset
207
- });
208
- if (!result.body) {
209
- return [];
210
- }
211
- return result.body.refs;
178
+ async function findReferences(tspClient, args) {
179
+ const file = args.file;
180
+ const result = await tspClient.request("references" /* CommandTypes.References */, {
181
+ file,
182
+ line: args.start.line,
183
+ offset: args.start.offset,
212
184
  });
185
+ if (!result.body) {
186
+ return [];
187
+ }
188
+ return result.body.refs;
213
189
  }
214
190
  //# sourceMappingURL=calls.js.map
package/lib/calls.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"calls.js","sourceRoot":"","sources":["../src/calls.ts"],"names":[],"mappings":";;;;;;;;;AAEA,OAAO,KAAK,GAAG,MAAM,uBAAuB,CAAC;AAC7C,OAAO,KAAK,QAAQ,MAAM,kCAAkC,CAAC;AAG7D,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAG3G,MAAM,UAAgB,cAAc,CAAC,SAAoB,EAAE,IAAoC;;QAC3F,MAAM,UAAU,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;QACjC,MAAM,iBAAiB,GAAG,MAAM,aAAa,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;QAC/D,IAAI,CAAC,iBAAiB,EAAE;YACpB,OAAO,UAAU,CAAC;SACrB;QACD,MAAM,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;IACH,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE;QACd,OAAO,EAAE,CAAC;KACb;IACD,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;AAC5B,CAAC"}
package/lib/cli.js CHANGED
@@ -36,6 +36,6 @@ createLspConnection({
36
36
  tsserverPath: options.tsserverPath,
37
37
  tsserverLogFile: options.tsserverLogFile,
38
38
  tsserverLogVerbosity: options.tsserverLogVerbosity,
39
- showMessageLevel: logLevel
39
+ showMessageLevel: logLevel,
40
40
  }).listen();
41
41
  //# sourceMappingURL=cli.js.map