Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 19 additions & 6 deletions crates/oxc_language_server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,36 @@ This crate provides an [LSP](https://microsoft.github.io/language-server-protoco

## Supported LSP Specifications from Server

- [initialize](https://microsoft.github.io/language-server-protocol/specification#initialize)
- Returns the [Server Capabilities](#server-capabilities)
- [initialized](https://microsoft.github.io/language-server-protocol/specification#initialized)
- [shutdown](https://microsoft.github.io/language-server-protocol/specification#shutdown)
### [initialize](https://microsoft.github.io/language-server-protocol/specification#initialize)

Returns the [Server Capabilities](#server-capabilities).\
Initialization Options:

| Option Key | Value(s) | Default | Description |
| ------------ | ---------------------- | ---------------- | ---------------------------------------------------------------------------------------------------- |
| `run` | `"onSave" \| "onType"` | `"onType"` | Should the server lint the files when the user is typing or saving |
| `enable` | `true \| false` | `true` | Should the server lint files |
| `configPath` | `<string>` | `.oxlintrc.json` | Path to a oxlint configuration file, pass '' to enable nested configuration |
| `flags` | `Map<string, string>` | `<empty>` | Special oxc language server flags, currently only one flag key is supported: `disable_nested_config` |

### [initialized](https://microsoft.github.io/language-server-protocol/specification#initialized)

### [shutdown](https://microsoft.github.io/language-server-protocol/specification#shutdown)

### Workspace

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

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

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

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

Note: When nested configuration is active, the client should send all `.oxlintrc.json` configurations to the server after the [initialized](#initialized) response.

#### [workspace/executeCommand](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#workspace_executeCommand)

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)
Expand Down