typescript-language-server 3.3.3-0 → 4.1.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/README.md CHANGED
@@ -1,35 +1,34 @@
1
- [![Build Status](https://travis-ci.org/theia-ide/typescript-language-server.svg?branch=master)](https://travis-ci.org/theia-ide/typescript-language-server)
2
- [![Discord](https://img.shields.io/discord/873659987413573634)](https://discord.gg/AC7Vs6hwFa)
1
+ [![Discord][discord-src]][discord-href]
2
+ [![npm version][npm-version-src]][npm-version-href]
3
+ [![npm downloads][npm-downloads-src]][npm-downloads-href]
3
4
 
4
5
  # TypeScript Language Server
5
6
 
6
7
  [Language Server Protocol](https://github.com/Microsoft/language-server-protocol) implementation for TypeScript wrapping `tsserver`.
7
8
 
8
- [![https://nodei.co/npm/typescript-language-server.png?downloads=true&downloadRank=true&stars=true](https://nodei.co/npm/typescript-language-server.png?downloads=true&downloadRank=true&stars=true)](https://www.npmjs.com/package/typescript-language-server)
9
+ Based on concepts and ideas from https://github.com/prabirshrestha/typescript-language-server and originally maintained by [TypeFox](https://typefox.io).
9
10
 
10
- Based on concepts and ideas from https://github.com/prabirshrestha/typescript-language-server and originally maintained by [TypeFox](https://typefox.io)
11
-
12
- Maintained by a [community of contributors](https://github.com/typescript-language-server/typescript-language-server/graphs/contributors) like you
11
+ Maintained by a [community of contributors](https://github.com/typescript-language-server/typescript-language-server/graphs/contributors) like you.
13
12
 
14
13
  <!-- MarkdownTOC -->
15
14
 
16
15
  - [Installing](#installing)
17
16
  - [Running the language server](#running-the-language-server)
18
17
  - [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
- - [Configure plugin](#configure-plugin)
30
- - [Inlay hints \(`textDocument/inlayHint`\)](#inlay-hints-textdocumentinlayhint)
31
- - [TypeScript Version Notification](#typescript-version-notification)
32
- - [Supported Protocol features](#supported-protocol-features)
18
+ - [Configuration](#configuration)
19
+ - [Features](#features)
20
+ - [Code actions on save](#code-actions-on-save)
21
+ - [Workspace commands \(`workspace/executeCommand`\)](#workspace-commands-workspaceexecutecommand)
22
+ - [Go to Source Definition](#go-to-source-definition)
23
+ - [Apply Workspace Edits](#apply-workspace-edits)
24
+ - [Apply Code Action](#apply-code-action)
25
+ - [Apply Refactoring](#apply-refactoring)
26
+ - [Organize Imports](#organize-imports)
27
+ - [Rename File](#rename-file)
28
+ - [Configure plugin](#configure-plugin)
29
+ - [Code Lenses \(`textDocument/codeLens`\)](#code-lenses-textdocumentcodelens)
30
+ - [Inlay hints \(`textDocument/inlayHint`\)](#inlay-hints-textdocumentinlayhint)
31
+ - [TypeScript Version Notification](#typescript-version-notification)
33
32
  - [Development](#development)
34
33
  - [Build](#build)
35
34
  - [Test](#test)
@@ -61,352 +60,16 @@ typescript-language-server --stdio
61
60
  -V, --version output the version number
62
61
  --stdio use stdio (required option)
63
62
  --log-level <log-level> A number indicating the log level (4 = log, 3 = info, 2 = warn, 1 = error). Defaults to `3`.
64
- --tsserver-log-verbosity <verbosity> [deprecated] Specify tsserver log verbosity (off, terse, normal, verbose). Defaults to `normal`. example: --tsserver-log-verbosity=verbose
65
- --tsserver-path <path> [deprecated] Specify path to tsserver directory. example: --tsserver-path=/Users/me/typescript/lib/
66
63
  -h, --help output usage information
67
64
  ```
68
65
 
69
- > The `--tsserver-log-verbosity` and `--tsserver-path` options are deprecated and it is recommended to pass those through corresponding `tsserver.*` `initializationOptions` instead.
70
-
71
- > Note: The path passed to `--tsserver-path` should be a path to the `[...]/typescript/lib/tssserver.js` file or to the `[...]/typescript/lib/` directory and not to the shell script `[...]/node_modules/.bin/tsserver`. Though for backward-compatibility reasons, the server will try to do the right thing even when passed a path to the shell script.
72
-
73
- ## initializationOptions
74
-
75
- The language server accepts various settings through the `initializationOptions` object passed through the `initialize` request. Refer to your LSP client's documentation on how to set these. Here is the list of supported options:
76
-
77
- | Setting | Type | Description |
78
- |:------------------|:---------|:--------------------------------------------------------------------------------------|
79
- | hostInfo | string | Information about the host, for example `"Emacs 24.4"` or `"Sublime Text v3075"`. **Default**: `undefined` |
80
- | completionDisableFilterText | boolean | Don't set `filterText` property on completion items. **Default**: `false` |
81
- | disableAutomaticTypingAcquisition | boolean | Disables tsserver from automatically fetching missing type definitions (`@types` packages) for external modules. |
82
- | maxTsServerMemory | number | The maximum size of the V8's old memory section in megabytes (for example `4096` means 4GB). The default value is dynamically configured by Node so can differ per system. Increase for very big projects that exceed allowed memory usage. **Default**: `undefined` |
83
- | npmLocation | string | Specifies the path to the NPM executable used for Automatic Type Acquisition. |
84
- | locale | string | The locale to use to show error messages. |
85
- | plugins | object[] | An array of `{ name: string, location: string }` objects for registering a Typescript plugins. **Default**: [] |
86
- | preferences | object | Preferences passed to the Typescript (`tsserver`) process. See below for more |
87
- | tsserver | object | Options related to the `tsserver` process. See below for more |
88
-
89
- The `tsserver` setting specifies additional options related to the internal `tsserver` process, like tracing and logging.
90
-
91
- ```ts
92
- interface TsserverOptions {
93
- /**
94
- * The path to the directory where the `tsserver` log files will be created.
95
- * If not provided, the log files will be created within the workspace, inside the `.log` directory.
96
- * If no workspace root is provided when initializating the server and no custom path is specified then
97
- * the logs will not be created.
98
- *
99
- * @default undefined
100
- */
101
- logDirectory?: string;
102
- /**
103
- * Verbosity of the information logged into the `tsserver` log files.
104
- *
105
- * Log levels from least to most amount of details: `'terse'`, `'normal'`, `'requestTime`', `'verbose'`.
106
- * Enabling particular level also enables all lower levels.
107
- *
108
- * @default 'off'
109
- */
110
- logVerbosity?: 'off' | 'terse' | 'normal' | 'requestTime' | 'verbose';
111
- /**
112
- * The path to the `tsserver.js` file or the typescript lib directory. For example: `/Users/me/typescript/lib/tsserver.js`.
113
- */
114
- path?: string;
115
- /**
116
- * The verbosity of logging of the tsserver communication.
117
- * Delivered through the LSP messages and not related to file logging.
118
- *
119
- * @default 'off'
120
- */
121
- trace?: 'off' | 'messages' | 'verbose';
122
- /**
123
- * Whether a dedicated server is launched to more quickly handle syntax related operations, such as computing diagnostics or code folding.
124
- *
125
- * Allowed values:
126
- * - auto: Spawn both a full server and a lighter weight server dedicated to syntax operations. The syntax server is used to speed up syntax operations and provide IntelliSense while projects are loading.
127
- * - never: Don't use a dedicated syntax server. Use a single server to handle all IntelliSense operations.
128
- *
129
- * @default 'auto'
130
- */
131
- useSyntaxServer?: 'auto' | 'never';
132
- }
133
- ```
134
-
135
- The `preferences` object is an object specifying preferences for the internal `tsserver` process. Those options depend on the version of Typescript used but at the time of writing Typescript v4.4.3 contains these options:
136
-
137
- ```ts
138
- interface UserPreferences {
139
- /**
140
- * Glob patterns of files to exclude from auto imports. Requires using TypeScript 4.8 or newer in the workspace.
141
- * Relative paths are resolved relative to the workspace root.
142
- * @since 4.8.2
143
- */
144
- autoImportFileExcludePatterns: [],
145
- disableSuggestions: boolean;
146
- quotePreference: "auto" | "double" | "single";
147
- /**
148
- * If enabled, TypeScript will search through all external modules' exports and add them to the completions list.
149
- * This affects lone identifier completions but not completions on the right hand side of `obj.`.
150
- */
151
- includeCompletionsForModuleExports: boolean;
152
- /**
153
- * Enables auto-import-style completions on partially-typed import statements. E.g., allows
154
- * `import write|` to be completed to `import { writeFile } from "fs"`.
155
- */
156
- includeCompletionsForImportStatements: boolean;
157
- /**
158
- * Allows completions to be formatted with snippet text, indicated by `CompletionItem["isSnippet"]`.
159
- */
160
- includeCompletionsWithSnippetText: boolean;
161
- /**
162
- * If enabled, the completion list will include completions with invalid identifier names.
163
- * For those entries, The `insertText` and `replacementSpan` properties will be set to change from `.x` property access to `["x"]`.
164
- */
165
- includeCompletionsWithInsertText: boolean;
166
- /**
167
- * Unless this option is `false`, or `includeCompletionsWithInsertText` is not enabled,
168
- * member completion lists triggered with `.` will include entries on potentially-null and potentially-undefined
169
- * values, with insertion text to replace preceding `.` tokens with `?.`.
170
- */
171
- includeAutomaticOptionalChainCompletions: boolean;
172
- /**
173
- * If enabled, completions for class members (e.g. methods and properties) will include
174
- * a whole declaration for the member.
175
- * E.g., `class A { f| }` could be completed to `class A { foo(): number {} }`, instead of
176
- * `class A { foo }`.
177
- * @since 4.5.2
178
- * @default true
179
- */
180
- includeCompletionsWithClassMemberSnippets: boolean;
181
- /**
182
- * If enabled, object literal methods will have a method declaration completion entry in addition
183
- * to the regular completion entry containing just the method name.
184
- * E.g., `const objectLiteral: T = { f| }` could be completed to `const objectLiteral: T = { foo(): void {} }`,
185
- * in addition to `const objectLiteral: T = { foo }`.
186
- * @since 4.7.2
187
- * @default true
188
- */
189
- includeCompletionsWithObjectLiteralMethodSnippets: boolean;
190
- /**
191
- * Indicates whether {@link CompletionEntry.labelDetails completion entry label details} are supported.
192
- * If not, contents of `labelDetails` may be included in the {@link CompletionEntry.name} property.
193
- * Only supported if the client supports `textDocument.completion.completionItem.labelDetailsSupport` capability
194
- * and a compatible TypeScript version is used.
195
- * @since 4.7.2
196
- * @default true
197
- */
198
- useLabelDetailsInCompletionEntries: boolean;
199
- /**
200
- * Allows import module names to be resolved in the initial completions request.
201
- * @default false
202
- */
203
- allowIncompleteCompletions: boolean;
204
- importModuleSpecifierPreference: "shortest" | "project-relative" | "relative" | "non-relative";
205
- /** Determines whether we import `foo/index.ts` as "foo", "foo/index", or "foo/index.js" */
206
- importModuleSpecifierEnding: "auto" | "minimal" | "index" | "js";
207
- allowTextChangesInNewFiles: boolean;
208
- lazyConfiguredProjectsFromExternalProject: boolean;
209
- /**
210
- * Indicates whether imports should be organized in a case-insensitive manner.
211
- *
212
- * Default: `"auto"`.
213
- */
214
- organizeImportsIgnoreCase: "auto" | boolean;
215
- /**
216
- * Indicates whether imports should be organized via an "ordinal" (binary) comparison using the numeric value
217
- * of their code points, or via "unicode" collation (via the
218
- * [Unicode Collation Algorithm](https://unicode.org/reports/tr10/#Scope)) using rules associated with the locale
219
- * specified in {@link organizeImportsCollationLocale}.
220
- *
221
- * Default: `"ordinal"`.
222
- */
223
- organizeImportsCollation: "ordinal" | "unicode";
224
- /**
225
- * Indicates the locale to use for "unicode" collation. If not specified, the locale `"en"` is used as an invariant
226
- * for the sake of consistent sorting. Use `"auto"` to use the detected UI locale.
227
- *
228
- * This preference is ignored if {@link organizeImportsCollation} is not `"unicode"`.
229
- *
230
- * Default: `"en"`
231
- */
232
- organizeImportsCollationLocale: string;
233
- /**
234
- * Indicates whether numeric collation should be used for digit sequences in strings. When `true`, will collate
235
- * strings such that `a1z < a2z < a100z`. When `false`, will collate strings such that `a1z < a100z < a2z`.
236
- *
237
- * This preference is ignored if {@link organizeImportsCollation} is not `"unicode"`.
238
- *
239
- * Default: `false`
240
- */
241
- organizeImportsNumericCollation: boolean;
242
- /**
243
- * Indicates whether accents and other diacritic marks are considered unequal for the purpose of collation. When
244
- * `true`, characters with accents and other diacritics will be collated in the order defined by the locale specified
245
- * in {@link organizeImportsCollationLocale}.
246
- *
247
- * This preference is ignored if {@link organizeImportsCollation} is not `"unicode"`.
248
- *
249
- * Default: `true`
250
- */
251
- organizeImportsAccentCollation: boolean;
252
- /**
253
- * Indicates whether upper case or lower case should sort first. When `false`, the default order for the locale
254
- * specified in {@link organizeImportsCollationLocale} is used.
255
- *
256
- * This preference is ignored if {@link organizeImportsCollation} is not `"unicode"`. This preference is also
257
- * ignored if we are using case-insensitive sorting, which occurs when {@link organizeImportsIgnoreCase} is `true`,
258
- * or if {@link organizeImportsIgnoreCase} is `"auto"` and the auto-detected case sensitivity is determined to be
259
- * case-insensitive.
260
- *
261
- * Default: `false`
262
- */
263
- organizeImportsCaseFirst: "upper" | "lower" | false;
264
- providePrefixAndSuffixTextForRename: boolean;
265
- provideRefactorNotApplicableReason: boolean;
266
- allowRenameOfImportPath: boolean;
267
- includePackageJsonAutoImports: "auto" | "on" | "off";
268
- /**
269
- * Preferred style for JSX attribute completions:
270
- * - `"auto"` - Insert `={}` or `=\"\"` after attribute names based on the prop type.
271
- * - `"braces"` - Insert `={}` after attribute names.
272
- * - `"none"` - Only insert attribute names.
273
- * @since 4.5.2
274
- * @default 'auto'
275
- */
276
- jsxAttributeCompletionStyle: "auto" | "braces" | "none";
277
- displayPartsForJSDoc: boolean;
278
- generateReturnInDocTemplate: boolean;
279
-
280
- includeInlayParameterNameHints: "none" | "literals" | "all";
281
- includeInlayParameterNameHintsWhenArgumentMatchesName: boolean;
282
- includeInlayFunctionParameterTypeHints: boolean,
283
- includeInlayVariableTypeHints: boolean;
284
- /**
285
- * When disabled then type hints on variables whose name is identical to the type name won't be shown. Requires using TypeScript 4.8+ in the workspace.
286
- * @since 4.8.2
287
- * @default false
288
- */
289
- includeInlayVariableTypeHintsWhenTypeMatchesName: boolean;
290
- includeInlayPropertyDeclarationTypeHints: boolean;
291
- includeInlayFunctionLikeReturnTypeHints: boolean;
292
- includeInlayEnumMemberValueHints: boolean;
293
- }
294
- ```
295
-
296
- From the `preferences` options listed above, this server explicilty sets the following options (all other options use their default values):
297
-
298
- ```js
299
- {
300
- allowIncompleteCompletions: true,
301
- allowRenameOfImportPath: true,
302
- allowTextChangesInNewFiles: true,
303
- displayPartsForJSDoc: true,
304
- generateReturnInDocTemplate: true,
305
- includeAutomaticOptionalChainCompletions: true,
306
- includeCompletionsForImportStatements: true,
307
- includeCompletionsForModuleExports: true,
308
- includeCompletionsWithClassMemberSnippets: true,
309
- includeCompletionsWithObjectLiteralMethodSnippets: true,
310
- includeCompletionsWithInsertText: true,
311
- includeCompletionsWithSnippetText: true,
312
- jsxAttributeCompletionStyle: "auto",
313
- providePrefixAndSuffixTextForRename: true,
314
- provideRefactorNotApplicableReason: true,
315
- }
316
- ```
317
-
318
- ## workspace/didChangeConfiguration
66
+ ## Configuration
319
67
 
320
- Some of the preferences can be controlled through the `workspace/didChangeConfiguration` notification. Below is a list of supported options that can be passed. Note that the settings are specified separately for the typescript and javascript files so `[language]` can be either `javascript` or `typescript`.
68
+ See [configuration documentation](./docs/configuration.md).
321
69
 
322
- ```ts
323
- // Formatting preferences
324
- [language].format.baseIndentSize: number;
325
- [language].format.convertTabsToSpaces: boolean;
326
- [language].format.indentSize: number;
327
- [language].format.indentStyle: 'None' | 'Block' | 'Smart';
328
- [language].format.insertSpaceAfterCommaDelimiter: boolean;
329
- [language].format.insertSpaceAfterConstructor: boolean;
330
- [language].format.insertSpaceAfterFunctionKeywordForAnonymousFunctions: boolean;
331
- [language].format.insertSpaceAfterKeywordsInControlFlowStatements: boolean;
332
- [language].format.insertSpaceAfterOpeningAndBeforeClosingEmptyBraces: boolean;
333
- [language].format.insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces: boolean;
334
- [language].format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces: boolean;
335
- [language].format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets: boolean;
336
- [language].format.insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: boolean;
337
- [language].format.insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces: boolean;
338
- [language].format.insertSpaceAfterSemicolonInForStatements: boolean;
339
- [language].format.insertSpaceAfterTypeAssertion: boolean;
340
- [language].format.insertSpaceBeforeAndAfterBinaryOperators: boolean;
341
- [language].format.insertSpaceBeforeFunctionParenthesis: boolean;
342
- [language].format.insertSpaceBeforeTypeAnnotation: boolean;
343
- [language].format.newLineCharacter: string;
344
- [language].format.placeOpenBraceOnNewLineForControlBlocks: boolean;
345
- [language].format.placeOpenBraceOnNewLineForFunctions: boolean;
346
- [language].format.semicolons: 'ignore' | 'insert' | 'remove';
347
- [language].format.tabSize: number;
348
- [language].format.trimTrailingWhitespace: boolean;
349
- // Inlay Hints preferences
350
- [language].inlayHints.includeInlayEnumMemberValueHints: boolean;
351
- [language].inlayHints.includeInlayFunctionLikeReturnTypeHints: boolean;
352
- [language].inlayHints.includeInlayFunctionParameterTypeHints: boolean;
353
- [language].inlayHints.includeInlayParameterNameHints: 'none' | 'literals' | 'all';
354
- [language].inlayHints.includeInlayParameterNameHintsWhenArgumentMatchesName: boolean;
355
- [language].inlayHints.includeInlayPropertyDeclarationTypeHints: boolean;
356
- [language].inlayHints.includeInlayVariableTypeHints: boolean;
357
- [language].inlayHints.includeInlayVariableTypeHintsWhenTypeMatchesName: boolean;
358
- /**
359
- * Complete functions with their parameter signature.
360
- *
361
- * This functionality relies on LSP client resolving the completion using the `completionItem/resolve` call. If the
362
- * client can't do that before inserting the completion then it's not safe to enable it as it will result in some
363
- * completions having a snippet type without actually being snippets, which can then cause problems when inserting them.
364
- *
365
- * @default false
366
- */
367
- completions.completeFunctionCalls: boolean;
368
- // Diagnostics code to be omitted when reporting diagnostics.
369
- // See https://github.com/microsoft/TypeScript/blob/master/src/compiler/diagnosticMessages.json for a full list of valid codes.
370
- diagnostics.ignoredCodes: number[];
371
- /**
372
- * Enable/disable semantic checking of JavaScript files. Existing `jsconfig.json` or `tsconfig.json` files override this setting.
373
- *
374
- * @default false
375
- */
376
- implicitProjectConfiguration.checkJs: boolean;
377
- /**
378
- * Enable/disable `experimentalDecorators` in JavaScript files that are not part of a project. Existing `jsconfig.json` or `tsconfig.json` files override this setting.
379
- *
380
- * @default false
381
- */
382
- implicitProjectConfiguration.experimentalDecorators: boolean;
383
- /**
384
- * Sets the module system for the program. See more: https://www.typescriptlang.org/tsconfig#module.
385
- *
386
- * @default 'ESNext'
387
- */
388
- implicitProjectConfiguration.module: string;
389
- /**
390
- * Enable/disable [strict function types](https://www.typescriptlang.org/tsconfig#strictFunctionTypes) in JavaScript and TypeScript files that are not part of a project. Existing `jsconfig.json` or `tsconfig.json` files override this setting.
391
- *
392
- * @default true
393
- */
394
- implicitProjectConfiguration.strictFunctionTypes: boolean;
395
- /**
396
- * Enable/disable [strict null checks](https://www.typescriptlang.org/tsconfig#strictNullChecks) in JavaScript and TypeScript files that are not part of a project. Existing `jsconfig.json` or `tsconfig.json` files override this setting.
397
- *
398
- * @default true
399
- */
400
- implicitProjectConfiguration.strictNullChecks: boolean;
401
- /**
402
- * Set target JavaScript language version for emitted JavaScript and include library declarations. See more: https://www.typescriptlang.org/tsconfig#target.
403
- *
404
- * @default 'ES2020'
405
- */
406
- implicitProjectConfiguration.target: string;
407
- ```
70
+ ## Features
408
71
 
409
- ## Code actions on save
72
+ ### Code actions on save
410
73
 
411
74
  Server announces support for the following code action kinds:
412
75
 
@@ -431,7 +94,7 @@ The user can enable it with a setting similar to (can vary per-editor):
431
94
  }
432
95
  ```
433
96
 
434
- ## Workspace commands (`workspace/executeCommand`)
97
+ ### Workspace commands (`workspace/executeCommand`)
435
98
 
436
99
  See [LSP specification](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#workspace_executeCommand).
437
100
 
@@ -439,7 +102,7 @@ Most of the time, you'll execute commands with arguments retrieved from another
439
102
 
440
103
  `lsp` refers to the language server protocol types, `tsp` refers to the typescript server protocol types.
441
104
 
442
- ### Go to Source Definition
105
+ #### Go to Source Definition
443
106
 
444
107
  - Request:
445
108
  ```ts
@@ -458,7 +121,7 @@ Most of the time, you'll execute commands with arguments retrieved from another
458
121
 
459
122
  (This command is supported from Typescript 4.7.)
460
123
 
461
- ### Apply Workspace Edits
124
+ #### Apply Workspace Edits
462
125
 
463
126
  - Request:
464
127
  ```ts
@@ -472,7 +135,7 @@ Most of the time, you'll execute commands with arguments retrieved from another
472
135
  lsp.ApplyWorkspaceEditResult
473
136
  ```
474
137
 
475
- ### Apply Code Action
138
+ #### Apply Code Action
476
139
 
477
140
  - Request:
478
141
  ```ts
@@ -488,7 +151,7 @@ Most of the time, you'll execute commands with arguments retrieved from another
488
151
  void
489
152
  ```
490
153
 
491
- ### Apply Refactoring
154
+ #### Apply Refactoring
492
155
 
493
156
  - Request:
494
157
  ```ts
@@ -504,7 +167,7 @@ Most of the time, you'll execute commands with arguments retrieved from another
504
167
  void
505
168
  ```
506
169
 
507
- ### Organize Imports
170
+ #### Organize Imports
508
171
 
509
172
  - Request:
510
173
  ```ts
@@ -521,7 +184,7 @@ Most of the time, you'll execute commands with arguments retrieved from another
521
184
  void
522
185
  ```
523
186
 
524
- ### Rename File
187
+ #### Rename File
525
188
 
526
189
  - Request:
527
190
  ```ts
@@ -537,7 +200,7 @@ Most of the time, you'll execute commands with arguments retrieved from another
537
200
  void
538
201
  ```
539
202
 
540
- ### Configure plugin
203
+ #### Configure plugin
541
204
 
542
205
  - Request:
543
206
  ```ts
@@ -551,7 +214,39 @@ Most of the time, you'll execute commands with arguments retrieved from another
551
214
  void
552
215
  ```
553
216
 
554
- ## Inlay hints (`textDocument/inlayHint`)
217
+ ### Code Lenses (`textDocument/codeLens`)
218
+
219
+ Code lenses can be enabled using the `implementationsCodeLens` and `referencesCodeLens` [workspace configuration options](/docs/configuration.md/#workspacedidchangeconfiguration).
220
+
221
+ Code lenses provide a count of **references** and/or **implemenations** for symbols in the document. For clients that support it it's also possible to click on those to navigate to the relevant locations in the the project. Do note that clicking those trigger a `editor.action.showReferences` command which is something that client needs to have explicit support for. Many do by default but some don't. An example command will look like this:
222
+
223
+ ```ts
224
+ command: {
225
+ title: '1 reference',
226
+ command: 'editor.action.showReferences',
227
+ arguments: [
228
+ 'file://project/foo.ts', // URI
229
+ { line: 1, character: 1 }, // Position
230
+ [ // A list of Location objects.
231
+ {
232
+ uri: 'file://project/bar.ts',
233
+ range: {
234
+ start: {
235
+ line: 7,
236
+ character: 24,
237
+ },
238
+ end: {
239
+ line: 7,
240
+ character: 28,
241
+ },
242
+ },
243
+ },
244
+ ],
245
+ ],
246
+ }
247
+ ```
248
+
249
+ ### Inlay hints (`textDocument/inlayHint`)
555
250
 
556
251
  For the request to return any results, some or all of the following options need to be enabled through `preferences`:
557
252
 
@@ -568,7 +263,7 @@ export interface InlayHintsOptions extends UserPreferences {
568
263
  }
569
264
  ```
570
265
 
571
- ## TypeScript Version Notification
266
+ ### TypeScript Version Notification
572
267
 
573
268
  Right after initializing, the server sends a custom `$/typescriptVersion` notification that carries information about the version of TypeScript that is utilized by the server. The editor can then display that information in the UI.
574
269
 
@@ -577,35 +272,6 @@ The `$/typescriptVersion` notification params include two properties:
577
272
  - `version` - a semantic version (for example `4.8.4`)
578
273
  - `source` - a string specifying whether used TypeScript version comes from the local workspace (`workspace`), is explicitly specified through a `initializationOptions.tsserver.path` setting (`user-setting`) or was bundled with the server (`bundled`)
579
274
 
580
- ## Supported Protocol features
581
-
582
- - [x] textDocument/codeAction
583
- - [x] textDocument/completion (incl. `completion/resolve`)
584
- - [x] textDocument/definition
585
- - [x] textDocument/didChange (incremental)
586
- - [x] textDocument/didClose
587
- - [x] textDocument/didOpen
588
- - [x] textDocument/didSave
589
- - [x] textDocument/documentHighlight
590
- - [x] textDocument/documentSymbol
591
- - [x] textDocument/executeCommand
592
- - [x] textDocument/formatting
593
- - [x] textDocument/hover
594
- - [x] textDocument/inlayHint (no support for `inlayHint/resolve` or `workspace/inlayHint/refresh`)
595
- - [x] textDocument/linkedEditingRange
596
- - [x] textDocument/prepareCallHierarchy
597
- - [x] callHierarchy/incomingCalls
598
- - [x] callHierarchy/outgoingCalls
599
- - [x] textDocument/prepareRename
600
- - [x] textDocument/rangeFormatting
601
- - [x] textDocument/references
602
- - [x] textDocument/rename
603
- - [x] textDocument/selectionRange
604
- - [x] textDocument/signatureHelp
605
- - [x] workspace/symbol
606
- - [x] workspace/didChangeConfiguration
607
- - [x] workspace/executeCommand
608
-
609
275
  ## Development
610
276
 
611
277
  ### Build
@@ -629,4 +295,11 @@ yarn watch
629
295
 
630
296
  ### Publishing
631
297
 
632
- New version of the package is published automatically on pushing new tag to the upstream repo.
298
+ The project uses https://github.com/google-github-actions/release-please-action Github action to automatically release new version on merging a release PR.
299
+
300
+ [npm-version-src]: https://img.shields.io/npm/dt/typescript-language-server.svg?style=flat-square
301
+ [npm-version-href]: https://npmjs.com/package/typescript-language-server
302
+ [npm-downloads-src]: https://img.shields.io/npm/v/typescript-language-server/latest.svg?style=flat-square
303
+ [npm-downloads-href]: https://npmjs.com/package/typescript-language-server
304
+ [discord-src]: https://img.shields.io/discord/873659987413573634?style=flat-square
305
+ [discord-href]: https://discord.gg/AC7Vs6hwFa