1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-21 15:04:11 -05:00
denoland-deno/cli/lsp
Nayeem Rahman d28384c3de
refactor(lsp): store test definitions in adjacency list (#20330)
Previously:
```rust
pub struct TestDefinition {
  pub id: String,
  pub name: String,
  pub range: SourceRange,
  pub steps: Vec<TestDefinition>,
}

pub struct TestDefinitions {
  pub discovered: Vec<TestDefinition>,
  pub injected: Vec<lsp_custom::TestData>,
  pub script_version: String,
}
```
Now:
```rust
pub struct TestDefinition {
  pub id: String,
  pub name: String,
  pub range: Option<Range>,
  pub is_dynamic: bool, // True for 'injected' module, not statically detected but added at runtime.
  pub parent_id: Option<String>,
  pub step_ids: HashSet<String>,
}

pub struct TestModule {
  pub specifier: ModuleSpecifier,
  pub script_version: String,
  pub defs: HashMap<String, TestDefinition>,
}
```

Storing the test tree as a literal tree diminishes the value of IDs,
even though vscode stores them that way. This makes all data easily
accessible from `TestModule`. It unifies the interface between
'discovered' and 'injected' tests. This unblocks some enhancements wrt
syncing tests between the LSP and extension, such as this TODO:
61f08d5a71/client/src/testing.ts (L251-L259)
and https://github.com/denoland/vscode_deno/issues/900. We should also
get more flexibility overall.

`TestCollector` is cleaned up, now stores a `&mut TestModule` directly
and registers tests as it comes across them with
`TestModule::register()`. This method ensures sanity in the redundant
data from having both of `TestDefinition::{parent_id,step_ids}`.

All of the messy conversions between `TestDescription`,
`LspTestDescription`, `TestDefinition`, `TestData` and `TestIdentifier`
are cleaned up. They shouldn't have been using `impl From` and now the
full list of tests is available to their implementations.
2023-08-30 16:31:31 +01:00
..
testing refactor(lsp): store test definitions in adjacency list (#20330) 2023-08-30 16:31:31 +01:00
analysis.rs refactor: upgrade deno_ast 0.28 and deno_semver 0.4 (#20193) 2023-08-21 09:53:52 +00:00
cache.rs feat(unstable): optional deno_modules directory (#19977) 2023-08-02 00:49:09 +00:00
capabilities.rs fix: unexpected lsp function arg comma completion (#20311) 2023-08-28 17:07:22 +02:00
client.rs fix(ext/web): add stream tests to detect v8slice split bug (#20253) 2023-08-23 17:03:05 -06:00
code_lens.rs refactor(lsp): make RequestMethod private (#19114) 2023-05-12 19:07:40 -04:00
completions.rs feat(lsp): npm specifier completions (#20121) 2023-08-29 10:22:05 -05:00
config.rs feat(lsp): update imports on file rename (#20245) 2023-08-26 02:50:47 +02:00
diagnostics.rs fix(ext/web): add stream tests to detect v8slice split bug (#20253) 2023-08-23 17:03:05 -06:00
documents.rs chore(core): bump and trim deps (#20265) 2023-08-26 07:10:42 -06:00
language_server.rs fix(lsp): recreate npm search cache when cache path changes (#20327) 2023-08-29 16:24:19 +00:00
logging.rs fix(repl): improve package.json support (#18497) 2023-03-30 10:43:16 -04:00
lsp_custom.rs chore(lsp/tests): diagnostic synchronization (reland) (#19270) 2023-05-26 08:10:18 +02:00
mod.rs feat(lsp): npm specifier completions (#20121) 2023-08-29 10:22:05 -05:00
npm.rs feat(lsp): npm specifier completions (#20121) 2023-08-29 10:22:05 -05:00
parent_process_checker.rs fix(ext/web): add stream tests to detect v8slice split bug (#20253) 2023-08-23 17:03:05 -06:00
path_to_regex.rs chore: fix typos (#19572) 2023-06-26 09:10:27 -04:00
performance.rs refactor(lsp): fewer clones (#17551) 2023-01-26 23:24:03 +01:00
README.md feat(lsp): improve registry completion suggestions (#13023) 2021-12-14 06:24:11 +11:00
refactor.rs refactor(lsp): fewer clones (#17551) 2023-01-26 23:24:03 +01:00
registries.rs feat(lsp): npm specifier completions (#20121) 2023-08-29 10:22:05 -05:00
repl.rs feat(lsp): ability to configure document pre-load limit (#19097) 2023-05-11 17:17:14 -04:00
semantic_tokens.rs chore: use rustfmt imports_granularity option (#17421) 2023-01-14 23:18:58 -05:00
text.rs chore: update copyright year to 2023 (#17247) 2023-01-02 21:00:42 +00:00
tsc.rs fix(lsp): implement deno.suggest.completeFunctionCalls (#20214) 2023-08-26 02:53:44 +02:00
urls.rs feat(unstable/lsp): support navigating to deno_modules folder (#20030) 2023-08-02 16:57:25 -04: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.