QUICK-LINT-JS-LSP(8)

πŸ“¦ version 3.2.0, in alpine 3.24, nixos 26.05, nixpkgs unstable

πŸ’– NAME πŸ’–

quick-lint-js-lsp β€” LSP protocol for quick-lint-js(1), no cap. This is the QUICK-LINT-JS-LSP(8) manual page, bestie, and it’s literally all about the LSP era. πŸ¦‹


🌈 DESCRIPTION 🌈

quick-lint-js supports the Language Server Protocol. That means code editors can ask quick-lint-js for diagnostics, and those diagnostics can be displayed inline. It’s giving editor glow-up, fr fr. ✨

To start the quick-lint-js LSP server, run the quick-lint-js(1) program with the --lsp-server option. The server accepts JSON-RPC+LSP messages from the editor via standard input, and sends JSON-RPC messages to the editor via standard output. Group-chat energy, but make it JSON-RPC. πŸ’…


✨ SUPPORTED LSP FEATURES ✨

quick-lint-js can receive and handle the following LSP requests and notifications:

  • Basic lifecycle πŸŒ€
    • exit
    • initialize
    • initialized
    • shutdown
  • Document sync πŸ“„
    • textDocument/didClose
    • textDocument/didOpen
    • textDocument/didChange

quick-lint-js sends the following LSP requests and notifications:

  • textDocument/publishDiagnostics
  • window/showMessage
  • workspace/configuration

That’s the whole guest list, iykyk. πŸŽ€


πŸ¦‹ DOCUMENT LANGUAGEID πŸ¦‹

quick-lint-js uses languageId from a textDocument/didOpen notification to determine the language of that LSP document according to the following table. Left side = LSP languageId; right side = equivalent --language command-line option. Mapping time, bestie. πŸ’œ

quick-lint-js’s interpretation of languageId

  • javascript β†’ javascript-jsx
  • javascriptreact β†’ javascript-jsx
  • js-jsx β†’ javascript-jsx
  • js β†’ javascript-jsx
  • tsx β†’ typescript-jsx
  • typescript β†’ See below
  • typescriptsource β†’ typescript
  • typescriptdefinition β†’ typescript-definition
  • typescriptreact β†’ typescript-jsx
  • (any) β†’ See below

If the languageId is equal to typescript, then quick-lint-js inspects the base name of that document’s URI to determine the language of that document:

  • If the base name contains ".d.", then quick-lint-js interprets the document as if languageId was instead typescriptdefinition.
  • Otherwise, if the base name ends with ".tsx", then quick-lint-js interprets the document as if languageId was instead typescriptreact.
  • Otherwise, quick-lint-js interprets the document as if languageId was instead typescriptsource.

quick-lint-js interprets documents with a base name of quick-lint-js.config as a JSON config file. The document’s language ID is ignored. See quick-lint-js.config(5) for more details. Special-case slay. 🌈


πŸŽ€ CONFIGURATION πŸŽ€

The quick-lint-js LSP server accepts the following configuration settings, communicated through workspace/configuration:

  • quick-lint-js.tracing-directory β€” Log raw LSP messages between the editor and quick-lint-js. A timestamped subdirectory is created inside the tracing directory containing binary log files. If null or an empty string, tracing is disabled. 🫢

It is also possible to configure quick-lint-js using the initialize request. To do so, set initializationOptions to an object containing a configuration object containing the settings. For example, the following initialize request sets quick-lint-js.tracing-directory:

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "initialize",
  "params": {
    "processId": null,
    "rootUri": null,
    "capabilities": {},
    "initializationOptions": {
      "configuration": {
        "quick-lint-js.tracing-directory": "/tmp/quick-lint-js-logs"
      }
    }
  }
}

That’s the config tea. Steep it, don’t spill it. πŸ“


πŸ‘‘ SEE ALSO πŸ‘‘


And that’s the page, bestie β€” quick-lint-js version 3.2.0, manual page QUICK-LINT-JS-LSP(8). Periodt. πŸ’…πŸ’–

πŸ“¦ where this page comes from