.\" Code generated by docs/man/generate-man-pages. DO NOT EDIT. .\" source: docs/*.adoc . .\" Copyright (C) 2020 Matthew "strager" Glazar .\" See end of file for extended copyright information. . .\" Manual page for the 'man' utility. . . '\" t .\" Title: quick-lint-js-lsp .\" Author: [see the "AUTHOR(S)" section] .\" Generator: Asciidoctor 2.0.17 .\" Manual: \ \& .\" Source: quick-lint-js version 3.2.0 .\" Language: English .\" .TH "QUICK\-LINT\-JS\-LSP" "8" "" "quick\-lint\-js version 3.2.0" "\ \&" .ie \n(.g .ds Aq \(aq .el .ds Aq ' .ss \n[.ss] 0 .nh .ad l .de URL \fI\\$2\fP <\\$1>\\$3 .. .als MTO URL .if \n[.g] \{\ . mso www.tmac . am URL . ad l . . . am MTO . ad l . . . LINKSTYLE blue R < > .\} .SH "NAME" quick-lint-js-lsp \- LSP protocol for *quick\-lint\-js*(1) .SH "DESCRIPTION" .sp quick\-lint\-js supports the Language Server Protocol. This allows code editors to ask quick\-lint\-js for diagnostics which can be displayed inline. .sp To start the quick\-lint\-js LSP server, run the \fBquick\-lint\-js\fP(1) program with the \fB\-\-lsp\-server\fP 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. .SH "SUPPORTED LSP FEATURES" .sp quick\-lint\-js can receive and handle the following LSP requests and notifications: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ . sp -1 . IP \(bu 2.3 .\} Basic lifecycle .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ . sp -1 . IP \(bu 2.3 .\} \f(CRexit\fP .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ . sp -1 . IP \(bu 2.3 .\} \f(CRinitialize\fP .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ . sp -1 . IP \(bu 2.3 .\} \f(CRinitialized\fP .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ . sp -1 . IP \(bu 2.3 .\} \f(CRshutdown\fP .RE .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ . sp -1 . IP \(bu 2.3 .\} Document sync .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ . sp -1 . IP \(bu 2.3 .\} \f(CRtextDocument/didClose\fP .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ . sp -1 . IP \(bu 2.3 .\} \f(CRtextDocument/didOpen\fP .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ . sp -1 . IP \(bu 2.3 .\} \f(CRtextDocument/didChange\fP .RE .RE .sp quick\-lint\-js sends the following LSP requests and notifications: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ . sp -1 . IP \(bu 2.3 .\} \f(CRtextDocument/publishDiagnostics\fP .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ . sp -1 . IP \(bu 2.3 .\} \f(CRwindow/showMessage\fP .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ . sp -1 . IP \(bu 2.3 .\} \f(CRworkspace/configuration\fP .RE .SH "DOCUMENT LANGUAGEID" .sp quick\-lint\-js uses \f(CRlanguageId\fP from a \f(CRtextDocument/didOpen\fP notification to determine the language of that LSP document according to the following table: .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .B quick\-lint\-js\(cqs interpretation of languageId .TS allbox tab(:); lt lt. T{ .sp LSP languageId T}:T{ .sp Equivalent \fB\-\-language\fP .br command\-line option T} T{ .sp \f(CRjavascript\fP T}:T{ .sp \f(CRjavascript\-jsx\fP T} T{ .sp \f(CRjavascriptreact\fP T}:T{ .sp \f(CRjavascript\-jsx\fP T} T{ .sp \f(CRjs\-jsx\fP T}:T{ .sp \f(CRjavascript\-jsx\fP T} T{ .sp \f(CRjs\fP T}:T{ .sp \f(CRjavascript\-jsx\fP T} T{ .sp \f(CRtsx\fP T}:T{ .sp \f(CRtypescript\-jsx\fP T} T{ .sp \f(CRtypescript\fP T}:T{ .sp See below T} T{ .sp \f(CRtypescriptsource\fP T}:T{ .sp \f(CRtypescript\fP T} T{ .sp \f(CRtypescriptdefinition\fP T}:T{ .sp \f(CRtypescript\-definition\fP T} T{ .sp \f(CRtypescriptreact\fP T}:T{ .sp \f(CRtypescript\-jsx\fP T} T{ .sp (any) T}:T{ .sp See below T} .TE .sp .sp If the \f(CRlanguageId\fP is equal to \f(CRtypescript\fP, then quick\-lint\-js inspects the base name of that document\(cqs URI to determine the language of that document: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ . sp -1 . IP \(bu 2.3 .\} If the base name contains ".d.", then quick\-lint\-js interprets the document as if \f(CRlanguageId\fP was instead \f(CRtypescriptdefinition\fP. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ . sp -1 . IP \(bu 2.3 .\} Otherwise, if the base name ends with ".tsx", then quick\-lint\-js interprets the document as if \f(CRlanguageId\fP was instead \f(CRtypescriptreact\fP. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ . sp -1 . IP \(bu 2.3 .\} Otherwise, quick\-lint\-js interprets the document as if \f(CRlanguageId\fP was instead \f(CRtypescriptsource\fP. .RE .sp quick\-lint\-js interprets documents with a base name of \f(CRquick\-lint\-js.config\fP as a JSON config file. The document\(cqs language ID is ignored. See \fBquick\-lint\-js.config\fP(5) for more details. .SH "CONFIGURATION" .sp The quick\-lint\-js LSP server accepts the following configuration settings, communicated through \f(CRworkspace/configuration\fP: .sp \f(CRquick\-lint\-js.tracing\-directory\fP .RS 4 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. .RE .sp It is also possible to configure quick\-lint\-js using the \f(CRinitialize\fP request. To do so, set \f(CRinitializationOptions\fP to an object containing a \f(CRconfiguration\fP object containing the settings. For example, the following \f(CRinitialize\fP request sets \f(CRquick\-lint\-js.tracing\-directory\fP: .sp .if n .RS 4 .nf .fam C { "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" } } } } .fam .fi .if n .RE .SH "SEE ALSO" .sp \fBquick\-lint\-js\fP(1) .\" quick-lint-js finds bugs in JavaScript programs. .\" Copyright (C) 2020 Matthew "strager" Glazar .\" .\" This file is part of quick-lint-js. .\" .\" quick-lint-js is free software: you can redistribute it and/or modify .\" it under the terms of the GNU General Public License as published by .\" the Free Software Foundation, either version 3 of the License, or .\" (at your option) any later version. .\" .\" quick-lint-js is distributed in the hope that it will be useful, .\" but WITHOUT ANY WARRANTY; without even the implied warranty of .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the .\" GNU General Public License for more details. .\" .\" You should have received a copy of the GNU General Public License .\" along with quick-lint-js. If not, see <https://www.gnu.org/licenses/>.