1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-28 16:20:57 -05:00
denoland-deno/cli/lsp
Nathan Whitaker 36d877be4a
perf(lsp): Cache semantic tokens for open documents (#23799)
VScode will typically send a `textDocument/semanticTokens/full` request
followed by `textDocument/semanticTokens/range`, and occassionally
request semantic tokens even when we know nothing has changed. Semantic
tokens also get refreshed on each change. Computing semantic tokens is
relatively heavy in TSC, so we should avoid it as much as possible.

Caches the semantic tokens for open documents, to avoid making TSC do
unnecessary work. Results in a noticeable improvement in local
benchmarking

before:
```
Starting Deno benchmark
-> Start benchmarking lsp
   - Simple Startup/Shutdown 
      (10 runs, mean: 383ms)
   - Big Document/Several Edits 
      (5 runs, mean: 1079ms)
   - Find/Replace
      (10 runs, mean: 59ms)
   - Code Lens
      (10 runs, mean: 440ms)
   - deco-cx/apps Multiple Edits + Navigation
      (5 runs, mean: 9921ms)
<- End benchmarking lsp
```

after:
```
Starting Deno benchmark
-> Start benchmarking lsp
   - Simple Startup/Shutdown 
      (10 runs, mean: 395ms)
   - Big Document/Several Edits 
      (5 runs, mean: 1024ms)
   - Find/Replace
      (10 runs, mean: 56ms)
   - Code Lens
      (10 runs, mean: 438ms)
   - deco-cx/apps Multiple Edits + Navigation
      (5 runs, mean: 8927ms)
<- End benchmarking lsp
```
2024-05-15 01:51:48 +00:00
..
testing fix(compile): relative permissions should be retained as relative (#23719) 2024-05-06 19:21:58 -04:00
analysis.rs refactor(lsp): reland move resolver fields to LspResolver (#23685) 2024-05-07 03:20:15 +01:00
cache.rs refactor(lsp): unify caching into LspCache (#23746) 2024-05-09 20:22:27 +01:00
capabilities.rs chore(lsp): rename client-side command invocations (#22140) 2024-01-28 21:56:45 +00:00
client.rs refactor(lsp): cleanup partially locking methods (#23723) 2024-05-08 06:34:42 +01:00
code_lens.rs fix(lsp): show reference code lens on methods (#23804) 2024-05-14 22:42:35 +01:00
completions.rs refactor(lsp): unify caching into LspCache (#23746) 2024-05-09 20:22:27 +01:00
config.rs refactor(lsp): unify caching into LspCache (#23746) 2024-05-09 20:22:27 +01:00
diagnostics.rs refactor(lsp): reuse CliGraphResolverOptions::sloppy_imports_resolver (#23764) 2024-05-13 17:55:31 +01:00
documents.rs perf(lsp): Cache semantic tokens for open documents (#23799) 2024-05-15 01:51:48 +00:00
jsr.rs refactor(lsp): cleanup cache and module registry update (#23620) 2024-05-03 20:52:58 +01:00
language_server.rs perf(lsp): Cache semantic tokens for open documents (#23799) 2024-05-15 01:51:48 +00:00
logging.rs chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
lsp_custom.rs fix(lsp): don't normalize urls in cache command params (#22182) 2024-01-30 17:17:34 +00:00
mod.rs refactor(lsp): unify resolver types into LspResolver (#23514) 2024-04-26 21:39:33 +01:00
npm.rs refactor(lsp): cleanup cache and module registry update (#23620) 2024-05-03 20:52:58 +01:00
parent_process_checker.rs fix(lsp): use a dedicated thread for the parent process checker (#21869) 2024-01-09 11:36:03 -05:00
path_to_regex.rs chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
performance.rs refactor(lsp): cleanup partially locking methods (#23723) 2024-05-08 06:34:42 +01:00
README.md docs: fix broken deno manual link (#20667) 2023-09-25 14:09:27 +02:00
refactor.rs chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
registries.rs refactor(lsp): cleanup cache and module registry update (#23620) 2024-05-03 20:52:58 +01:00
repl.rs chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
resolver.rs refactor(lsp): reuse CliGraphResolverOptions::sloppy_imports_resolver (#23764) 2024-05-13 17:55:31 +01:00
search.rs feat(lsp): jsr specifier completions (#22612) 2024-02-29 03:54:16 +00:00
semantic_tokens.rs perf(lsp): Cache semantic tokens for open documents (#23799) 2024-05-15 01:51:48 +00:00
text.rs fix(lsp): handle multiline semantic tokens (#23691) 2024-05-04 21:48:06 +01:00
tsc.rs refactor(lsp): reuse CliGraphResolverOptions::sloppy_imports_resolver (#23764) 2024-05-13 17:55:31 +01:00
urls.rs refactor: load bytes in deno_graph (#22212) 2024-02-01 03:15:22 +00: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.

This documentation has been moved to the Deno manual.