Skip to content

Commit

Permalink
docs(language_server): add readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Sysix committed Nov 23, 2024
1 parent d68c171 commit 8b6c2c5
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions crates/oxc_language_server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ 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)

Expand All @@ -22,41 +23,39 @@ This crate provides an [LSP](https://microsoft.github.io/language-server-protoco
#### [workspace/didChangeConfiguration](https://microsoft.github.io/language-server-protocol/specification#workspace_didChangeConfiguration)

The server expect this request when settings like `run`, `enable` or `configPath` are changed.
The server will revalidate or reset the diagnostics for all open files and send a [textDocument/publishDiagnostics](#textdocumentpublishdiagnostics) request to the client.
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 expect this request when the oxlint configuration is changed.
The server will revalidate the diagnostics for all open files and send a [textDocument/publishDiagnostics](#textdocumentpublishdiagnostics) request to the client.
The server will revalidate the diagnostics for all open files and send one or more [textDocument/publishDiagnostics](#textdocumentpublishdiagnostics) requests to the client.

### TextDocument

-- ToDo

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

-- ToDo
The server will validate the file content and send a [textDocument/publishDiagnostics](#textdocumentpublishdiagnostics) request to the client.

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

-- ToDo
When the configuration `run` is set to `onSave`, the server will validate the file content and send a [textDocument/publishDiagnostics](#textdocumentpublishdiagnostics) request to the client.

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

-- ToDo
When the configuration `run` is set to `onType`, the server will validate the file content and send a [textDocument/publishDiagnostics](#textdocumentpublishdiagnostics) request to the client.

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

-- ToDo
It will remove the reference internal.

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

-- ToDo
Returns a list of [CodeAction](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_codeAction)

## Expected LSP Specification from Client

### TextDocument

#### [textDocument/publishDiagnostics](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_publishDiagnostics)

-- ToDo
Returns a [PublishDiagnostic object](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#publishDiagnosticsParams)

0 comments on commit 8b6c2c5

Please sign in to comment.