1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-23 15:49:44 -05:00
denoland-deno/cli/lsp
Kitson Kelly 09b79463d7 feat(lsp): add asset cache regression test
When we migrated away from all the locks, there was a regression that
was not caught immediately. The tsc::get_asset() would attempt to modify
the snapshot, but the problem was that the snapshot was a .clone() of
the inner language server's assets, which meant that modifications to
that where lost. When we then attempted to do a hover on those assets,
the inner language servers assets didn't have the retrieved asset, and
therefore would throw an error.
2021-02-08 10:47:32 +01:00
..
analysis.rs fix(lsp): remove Sources mutex 2021-02-08 10:47:32 +01:00
capabilities.rs fix(lsp): support codeAction/resolve (#9405) 2021-02-06 07:10:53 +11:00
config.rs feat(lsp): add references code lens (#9316) 2021-02-01 14:30:41 +11:00
diagnostics.rs Update lspower dependency (#9179) 2021-01-29 14:34:33 -05:00
documents.rs feat(lsp): add references code lens (#9316) 2021-02-01 14:30:41 +11:00
language_server.rs feat(lsp): add asset cache regression test 2021-02-08 10:47:32 +01:00
mod.rs feat(lsp): add performance measurements (#9209) 2021-01-27 11:32:49 +11:00
performance.rs feat(lsp): add performance measurements (#9209) 2021-01-27 11:32:49 +11:00
README.md feat(lsp): add TS quick fix code actions (#9396) 2021-02-05 05:53:02 +11:00
sources.rs fix(lsp): remove Sources mutex 2021-02-08 10:47:32 +01:00
text.rs Update lspower dependency (#9179) 2021-01-29 14:34:33 -05:00
tsc.rs fix(lsp): remove Sources mutex 2021-02-08 10:47:32 +01:00
utils.rs chore: update copyright to 2021 (#9092) 2021-01-11 18:13:41 +01:00

Deno Language Server

The Deno Language Server provides a server implementation of the Language Server Protocol which is specifically tailored to provide a Deno view of code. It is integrated into the command line and can be started via the lsp sub-command.

⚠️ The Language Server is highly experimental and far from feature complete. This document gives an overview of the structure of the language server.

Structure

When the language server is started, a LanguageServer instance is created which holds all of the state of the language server. It also defines all of the methods that the client calls via the Language Server RPC protocol.

Custom requests

The LSP currently supports the following custom requests. A client should implement these in order to have a fully functioning client that integrates well with Deno:

  • deno/cache - This command will instruct Deno to attempt to cache a module and all of its dependencies. It expects an argument of { textDocument: TextDocumentIdentifier } to be passed.
  • deno/performance - Requests the return of the timing averages for the internal instrumentation of Deno.
  • deno/virtualTextDocument - Requests a virtual text document from the LSP, which is a read only document that can be displayed in the client. This allows clients to access documents in the Deno cache, like remote modules and TypeScript library files built into Deno. It also supports a special URL of deno:/status.md which provides a markdown formatted text document that contains details about the status of the LSP for display to a user.