Skip to content

Commit 8bc70b3

Browse files
authoredMar 19, 2025··
docs(language_server): tell about Initialization options + didChangeWatchedFiles for nested configuration (#9876)
1 parent 723fdfb commit 8bc70b3

File tree

1 file changed

+19
-6
lines changed

1 file changed

+19
-6
lines changed
 

‎crates/oxc_language_server/README.md

+19-6
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,36 @@ This crate provides an [LSP](https://microsoft.github.io/language-server-protoco
1717

1818
## Supported LSP Specifications from Server
1919

20-
- [initialize](https://microsoft.github.io/language-server-protocol/specification#initialize)
21-
- Returns the [Server Capabilities](#server-capabilities)
22-
- [initialized](https://microsoft.github.io/language-server-protocol/specification#initialized)
23-
- [shutdown](https://microsoft.github.io/language-server-protocol/specification#shutdown)
20+
### [initialize](https://microsoft.github.io/language-server-protocol/specification#initialize)
21+
22+
Returns the [Server Capabilities](#server-capabilities).\
23+
Initialization Options:
24+
25+
| Option Key | Value(s) | Default | Description |
26+
| ------------ | ---------------------- | ---------------- | ---------------------------------------------------------------------------------------------------- |
27+
| `run` | `"onSave" \| "onType"` | `"onType"` | Should the server lint the files when the user is typing or saving |
28+
| `enable` | `true \| false` | `true` | Should the server lint files |
29+
| `configPath` | `<string>` | `.oxlintrc.json` | Path to a oxlint configuration file, pass '' to enable nested configuration |
30+
| `flags` | `Map<string, string>` | `<empty>` | Special oxc language server flags, currently only one flag key is supported: `disable_nested_config` |
31+
32+
### [initialized](https://microsoft.github.io/language-server-protocol/specification#initialized)
33+
34+
### [shutdown](https://microsoft.github.io/language-server-protocol/specification#shutdown)
2435

2536
### Workspace
2637

2738
#### [workspace/didChangeConfiguration](https://microsoft.github.io/language-server-protocol/specification#workspace_didChangeConfiguration)
2839

29-
The server expects this request when settings like `run`, `enable` or `configPath` are changed.
40+
The server expects this request when settings like `run`, `enable`, `flags` or `configPath` are changed.
3041
The server will revalidate or reset the diagnostics for all open files and send one or more [textDocument/publishDiagnostics](#textdocumentpublishdiagnostics) requests to the client.
3142

3243
#### [workspace/didChangeWatchedFiles](https://microsoft.github.io/language-server-protocol/specification#workspace_didChangeWatchedFiles)
3344

34-
The server expects this request when the oxlint configuration is changed.
45+
The server expects this request when one oxlint configuration is changed, added or deleted.
3546
The server will revalidate the diagnostics for all open files and send one or more [textDocument/publishDiagnostics](#textdocumentpublishdiagnostics) requests to the client.
3647

48+
Note: When nested configuration is active, the client should send all `.oxlintrc.json` configurations to the server after the [initialized](#initialized) response.
49+
3750
#### [workspace/executeCommand](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#workspace_executeCommand)
3851

3952
Executes a [Command](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#workspace_executeCommand) if it exists. See [Server Capabilities](#server-capabilities)

0 commit comments

Comments
 (0)
Please sign in to comment.