Skip to content

JavaScript/TypeScript (RECOMMENDED)#

Server#

For more information about the LSP server, check typescript-language-server (formerly theia-ide / TypeFox).

Installation#

This Server supports automatic install. Install this language server with M-xlsp-install-serverRETts-lsRET.

npm i -g typescript-language-server; npm i -g typescript

Debugger: Yes (Firefox/Chrome)#

Available configurations#

lsp-clients-typescript-disable-automatic-typing-acquisition#

Type: boolean

Default: nil

Disable tsserver from automatically fetching missing type definitions. (@types packages) for external modules.


lsp-clients-typescript-log-verbosity#

Type: (choice (const off) (const terse) (const normal) (const requesttime) (const verbose))

Default: info

The verbosity level of the information printed in the log by tsserver.


lsp-clients-typescript-max-ts-server-memory#

Type: integer

Default: nil

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.


lsp-clients-typescript-npm-location#

Type: string

Default: nil

Specifies the path to the NPM exec used for Automatic Type Acquisition.


lsp-clients-typescript-plugins#

Type: (restricted-sexp :tag Vector :match-alternatives (lambda (xs) (and (vectorp xs) (seq-every-p (-lambda ((&plist :name :location)) (and name location)) xs))))

Default: []

The list of plugins to load. It should be a vector of plist with keys :location and :name where :name is the name of the package and :location is the directory containing the package. Example: (vector (list :name "@vsintellicode/typescript-intellicode-plugin" :location ".vscode/extensions/visualstudioexptteam. vscodeintellicode-1.1.9/"))


lsp-clients-typescript-prefer-use-project-ts-server#

Type: boolean

Default: nil

When set, prefers using the tsserver.js from your project. This can allow loading plugins configured in your tsconfig.json.


lsp-clients-typescript-preferences#

Type: plist

Default: nil

Preferences passed to the Typescript (tsserver) process. See https://github.com/typescript-language-server/typescript-language-server#initializationoptions for the list of preferences available in the latest version of TypeScript.


lsp-clients-typescript-server-args#

Type: (repeat string)

Default: (--stdio)

Extra arguments for the typescript-language-server language server.


lsp-clients-typescript-tls-path#

Type: string

Default: typescript-language-server

Path to the typescript-language-server binary.


lsp-clients-typescript-tsserver#

Type: plist

Default: nil

Options related to the tsserver process. See below for more info. See https://github.com/typescript-language-server/typescript-language-server#initializationoptions for the list of tsserver available in the latest version of TypeScript.


lsp-javascript-auto-closing-tags#

Type: boolean

Default: t

Enable/disable automatic closing of JSX tags. Requires using TypeScript 3.0 or newer in the workspace.


lsp-javascript-completions-complete-function-calls#

Type: boolean

Default: t

Complete function calls.


lsp-javascript-display-enum-member-value-hints#

Type: boolean

Default: nil

Show inlay hints for enum member values.


lsp-javascript-display-parameter-name-hints#

Type: (choice (const :tag none none) (const :tag literals literals) (const :tag all all))

Default: none

Level of hinting for parameter types.


lsp-javascript-display-parameter-name-hints-when-argument-matches-name#

Type: boolean

Default: nil

Show inlay hints for function parameters even when argument matches name (e.g. data variable passed as data parameter).


lsp-javascript-display-parameter-type-hints#

Type: boolean

Default: nil

Show inlay hints for function parameters.


lsp-javascript-display-property-declaration-type-hints#

Type: boolean

Default: nil

Show inlay hints for property declaration types.


lsp-javascript-display-return-type-hints#

Type: boolean

Default: nil

Show inlay hints for function return types.


lsp-javascript-display-variable-type-hints#

Type: boolean

Default: nil

Show inlay hints for variable types.


lsp-javascript-format-enable#

Type: boolean

Default: t

Enable/disable default JavaScript formatter.


lsp-javascript-format-insert-space-after-comma-delimiter#

Type: boolean

Default: t

Defines space handling after a comma delimiter.


lsp-javascript-format-insert-space-after-constructor#

Type: boolean

Default: nil

Defines space handling after the constructor keyword. Requires using TypeScript 2.3.0 or newer in the workspace.


lsp-javascript-format-insert-space-after-function-keyword-for-anonymous-functions#

Type: boolean

Default: t

Defines space handling after function keyword for anonymous functions.


lsp-javascript-format-insert-space-after-keywords-in-control-flow-statements#

Type: boolean

Default: t

Defines space handling after keywords in a control flow statement.


lsp-javascript-format-insert-space-after-opening-and-before-closing-empty-braces#

Type: boolean

Default: nil

Defines space handling after opening/before closing empty braces.


lsp-javascript-format-insert-space-after-opening-and-before-closing-jsx-expression-braces#

Type: boolean

Default: nil

Defines space handling after opening/before closing JSX expression braces.


lsp-javascript-format-insert-space-after-opening-and-before-closing-nonempty-braces#

Type: boolean

Default: t

Defines space handling after opening and before closing non-empty braces. Requires using TypeScript 2.3.0 or newer in the workspace.


lsp-javascript-format-insert-space-after-opening-and-before-closing-nonempty-brackets#

Type: boolean

Default: nil

Defines space handling after opening and before closing non-empty brackets.


lsp-javascript-format-insert-space-after-opening-and-before-closing-nonempty-parenthesis#

Type: boolean

Default: nil

Defines space handling after opening and before closing non-empty parenthesis.


lsp-javascript-format-insert-space-after-opening-and-before-closing-template-string-braces#

Type: boolean

Default: nil

Defines space handling after opening/before closing template string braces.


lsp-javascript-format-insert-space-after-semicolon-in-for-statements#

Type: boolean

Default: t

Defines space handling after a semicolon in a for statement.


lsp-javascript-format-insert-space-before-and-after-binary-operators#

Type: boolean

Default: t

Defines space handling after a binary operator.


lsp-javascript-format-insert-space-before-function-parenthesis#

Type: boolean

Default: nil

Defines space handling before function argument parentheses.


lsp-javascript-format-place-open-brace-on-new-line-for-control-blocks#

Type: boolean

Default: nil

Defines whether an open brace is put onto a new line for control blocks or not.


lsp-javascript-format-place-open-brace-on-new-line-for-functions#

Type: boolean

Default: nil

Defines whether an open brace is put onto a new line for functions or not.


lsp-javascript-implicit-project-config-check-js#

Type: boolean

Default: nil

Enable/disable semantic checking of JavaScript files. Existing jsconfig.json or tsconfig.json files override this setting. Requires using TypeScript 2.3.1 or newer in the workspace.


lsp-javascript-implicit-project-config-experimental-decorators#

Type: boolean

Default: nil


lsp-javascript-preferences-import-module-specifier#

Type: (choice (const auto) (const relative) (const non-relative))

Default: auto

Preferred path style for auto imports.


lsp-javascript-preferences-quote-style#

Type: (choice (const auto) (const single) (const double))

Default: auto


lsp-javascript-preferences-rename-shorthand-properties#

Type: boolean

Default: t

Enable/disable introducing aliases for object shorthand properties during renames. Requires using TypeScript 3.4 or newer in the workspace.


lsp-javascript-suggest-auto-imports#

Type: boolean

Default: t

Enable/disable auto import suggestions. Requires using TypeScript 2.6.1 or newer in the workspace.


lsp-javascript-suggest-complete-function-calls#

Type: boolean

Default: nil

Complete functions with their parameter signature.


lsp-javascript-suggest-complete-js-docs#

Type: boolean

Default: t

Enable/disable suggestion to complete JSDoc comments.


lsp-javascript-suggest-enabled#

Type: boolean

Default: t

Enabled/disable autocomplete suggestions.


lsp-javascript-suggest-names#

Type: boolean

Default: t

Enable/disable including unique names from the file in JavaScript suggestions.


lsp-javascript-suggest-paths#

Type: boolean

Default: t

Enable/disable suggestions for paths in import statements and require calls.


lsp-javascript-suggestion-actions-enabled#

Type: boolean

Default: t

Enable/disable suggestion diagnostics for JavaScript files in the editor. Requires using TypeScript 2.8 or newer in the workspace.


lsp-javascript-update-imports-on-file-move-enabled#

Type: (choice (const prompt) (const always) (const never))

Default: prompt

Prompt on each rename.


lsp-javascript-validate-enable#

Type: boolean

Default: t

Enable/disable JavaScript validation.


lsp-typescript-auto-closing-tags#

Type: boolean

Default: t

Enable/disable automatic closing of JSX tags. Requires using TypeScript 3.0 or newer in the workspace.


lsp-typescript-format-enable#

Type: boolean

Default: t

Enable/disable default TypeScript formatter.


lsp-typescript-format-insert-space-after-comma-delimiter#

Type: boolean

Default: t

Defines space handling after a comma delimiter.


lsp-typescript-format-insert-space-after-constructor#

Type: boolean

Default: nil

Defines space handling after the constructor keyword. Requires using TypeScript 2.3.0 or newer in the workspace.


lsp-typescript-format-insert-space-after-function-keyword-for-anonymous-functions#

Type: boolean

Default: t

Defines space handling after function keyword for anonymous functions.


lsp-typescript-format-insert-space-after-keywords-in-control-flow-statements#

Type: boolean

Default: t

Defines space handling after keywords in a control flow statement.


lsp-typescript-format-insert-space-after-opening-and-before-closing-empty-braces#

Type: boolean

Default: nil

Defines space handling after opening/before closing empty braces.


lsp-typescript-format-insert-space-after-opening-and-before-closing-jsx-expression-braces#

Type: boolean

Default: nil

Defines space handling after opening/before closing JSX expression braces.


lsp-typescript-format-insert-space-after-opening-and-before-closing-nonempty-braces#

Type: boolean

Default: t

Defines space handling after opening and before closing non-empty braces. Requires using TypeScript 2.3.0 or newer in the workspace.


lsp-typescript-format-insert-space-after-opening-and-before-closing-nonempty-brackets#

Type: boolean

Default: nil

Defines space handling after opening and before closing non-empty brackets.


lsp-typescript-format-insert-space-after-opening-and-before-closing-nonempty-parenthesis#

Type: boolean

Default: nil

Defines space handling after opening/before closing non-empty parenthesis.


lsp-typescript-format-insert-space-after-opening-and-before-closing-template-string-braces#

Type: boolean

Default: nil

Defines space handling after opening/before closing template string braces.


lsp-typescript-format-insert-space-after-semicolon-in-for-statements#

Type: boolean

Default: t

Defines space handling after a semicolon in a for statement.


lsp-typescript-format-insert-space-after-type-assertion#

Type: boolean

Default: nil

Defines space handling after type assertions in TypeScript. Requires using TypeScript 2.4 or newer in the workspace.


lsp-typescript-format-insert-space-before-and-after-binary-operators#

Type: boolean

Default: t

Defines space handling after a binary operator.


lsp-typescript-format-insert-space-before-function-parenthesis#

Type: boolean

Default: nil

Defines space handling before function argument parentheses.


lsp-typescript-format-place-open-brace-on-new-line-for-control-blocks#

Type: boolean

Default: nil

Defines whether an open brace is put onto a newline for control blocks.


lsp-typescript-format-place-open-brace-on-new-line-for-functions#

Type: boolean

Default: nil

Defines whether an open brace is put onto a new line for functions or not.


lsp-typescript-locale#

Type: (choice (const de) (const es) (const en) (const fr) (const it) (const ja) (const ko) (const ru) (const zh-CN) (const zh-TW) (const :tag default nil))

Default: nil


lsp-typescript-preferences-import-module-specifier#

Type: (choice (const auto) (const relative) (const non-relative))

Default: auto

Infer the shortest path type.


lsp-typescript-preferences-quote-style#

Type: (choice (const auto) (const single) (const double))

Default: auto


lsp-typescript-preferences-rename-shorthand-properties#

Type: boolean

Default: t

Enable/disable introducing aliases for object shorthand properties during renames. Requires using TypeScript 3.4 or newer in the workspace.


lsp-typescript-report-style-checks-as-warnings#

Type: boolean

Default: t

Report style checks as warnings.


lsp-typescript-suggest-auto-imports#

Type: boolean

Default: t

Enable/disable auto import suggestions. Requires using TypeScript 2.6.1 or newer in the workspace.


lsp-typescript-suggest-complete-function-calls#

Type: boolean

Default: nil

Complete functions with their parameter signature.


lsp-typescript-suggest-complete-js-docs#

Type: boolean

Default: t

Enable/disable suggestion to complete JSDoc comments.


lsp-typescript-suggest-enabled#

Type: boolean

Default: t

Enabled/disable autocomplete suggestions.


lsp-typescript-suggest-paths#

Type: boolean

Default: t

Enable/disable suggestions for paths in import statements and require calls.


lsp-typescript-suggestion-actions-enabled#

Type: boolean

Default: t

Enable/disable suggestion diagnostics for TypeScript files in the editor. Requires using TypeScript 2.8 or newer in the workspace.


lsp-typescript-surveys-enabled#

Type: boolean

Default: t

Enabled/disable occasional surveys that help us improve VS Code`s JavaScript and TypeScript support.


lsp-typescript-tsc-auto-detect#

Type: (choice (const on) (const off) (const build) (const watch))

Default: on

Controls auto detection of tsc tasks.


lsp-typescript-tsserver-plugin-paths#

Type: (repeat string)

Default: nil

Additional paths to discover Typescript Language Service plugins. Requires using TypeScript 2.3.0 or newer in the workspace.


lsp-typescript-tsserver-trace#

Type: (choice (const off) (const messages) (const verbose))

Default: off

Enables tracing of messages sent to the TS server. This trace can be used to diagnose TS Server issues. The trace may contain file paths, source code, and other potentially sensitive information from your project.


lsp-typescript-update-imports-on-file-move-enabled#

Type: (choice (const prompt) (const always) (const never))

Default: prompt

Enable/disable automatic updating of import paths when you rename or move a file in VS Code. Requires using TypeScript 2.9 or newer in the workspace.


lsp-typescript-validate-enable#

Type: boolean

Default: t

Enable/disable TypeScript validation.



Last update: November 22, 2024