0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-02-07 23:06:50 -05:00
denoland-deno/cli/lsp
Nathan Whitaker c31b670323
fix(lsp): ignore errors on ambient module imports (#27855)
This makes it so imports of ambient modules (e.g. `$app/environment` in
svelte, any virtual module in vite, or other module provided by a
bundler) don't error in the LSP.

The way this works is that when we request diagnostics from TSC, we also
respond with the list of ambient modules. Then, in the diagnostics code,
we save diagnostics (produced by deno) that may be invalidated as an
ambient module and wait to publish the diagnostics until we've received
the ambient modules from TSC.

The actual ambient modules you get from TSC can contain globs, e.g.
`*.css`. So when we get new ambient modules, we compile them all into a
regex and check erroring imports against that regex. Ambient modules
should change rarely, so in most cases we should be using a pre-compiled
regex, which executes in linear time (wrt the specifier length).

TODO:
- Ideally we should only publish once, right now we publish with the
filtered specifiers and then the TSC ones
- deno check (#27633)
2025-01-30 15:34:59 +01:00
..
testing refactor: create deno_lib crate (#27673) 2025-01-16 23:32:12 +01:00
analysis.rs perf(node_resolver): reduce url to/from path conversions (#27839) 2025-01-30 15:34:56 +01:00
cache.rs refactor: add WorkspaceFactory and ResolverFactory (#27766) 2025-01-30 15:34:53 +01:00
capabilities.rs chore: Happy New Year 2025 (#27509) 2025-01-09 15:19:16 -05:00
client.rs chore: Happy New Year 2025 (#27509) 2025-01-09 15:19:16 -05:00
code_lens.rs chore: Happy New Year 2025 (#27509) 2025-01-09 15:19:16 -05:00
completions.rs chore: Happy New Year 2025 (#27509) 2025-01-09 15:19:16 -05:00
config.rs fix(check): compiler options from workspace members (#27785) 2025-01-30 15:34:58 +01:00
diagnostics.rs fix(lsp): ignore errors on ambient module imports (#27855) 2025-01-30 15:34:59 +01:00
documents.rs refactor: use DataUrl from deno_media_type (#27783) 2025-01-30 15:34:52 +01:00
jsr.rs chore: Happy New Year 2025 (#27509) 2025-01-09 15:19:16 -05:00
language_server.rs fix(check): compiler options from workspace members (#27785) 2025-01-30 15:34:58 +01:00
logging.rs chore: Happy New Year 2025 (#27509) 2025-01-09 15:19:16 -05:00
lsp_custom.rs chore: Happy New Year 2025 (#27509) 2025-01-09 15:19:16 -05:00
mod.rs chore: Happy New Year 2025 (#27509) 2025-01-09 15:19:16 -05:00
npm.rs refactor: add WorkspaceFactory and ResolverFactory (#27766) 2025-01-30 15:34:53 +01:00
parent_process_checker.rs chore: Happy New Year 2025 (#27509) 2025-01-09 15:19:16 -05:00
path_to_regex.rs chore: Happy New Year 2025 (#27509) 2025-01-09 15:19:16 -05:00
performance.rs chore: Happy New Year 2025 (#27509) 2025-01-09 15:19:16 -05:00
README.md docs: fix broken deno manual link (#20667) 2023-09-25 14:09:27 +02:00
refactor.rs chore: Happy New Year 2025 (#27509) 2025-01-09 15:19:16 -05:00
registries.rs chore: Happy New Year 2025 (#27509) 2025-01-09 15:19:16 -05:00
repl.rs chore: Happy New Year 2025 (#27509) 2025-01-09 15:19:16 -05:00
resolver.rs fix(check): compiler options from workspace members (#27785) 2025-01-30 15:34:58 +01:00
search.rs chore: Happy New Year 2025 (#27509) 2025-01-09 15:19:16 -05:00
semantic_tokens.rs chore: Happy New Year 2025 (#27509) 2025-01-09 15:19:16 -05:00
text.rs refactor: update deno_core for error refactor (#26867) 2025-01-09 15:19:21 -05:00
tsc.rs fix(lsp): ignore errors on ambient module imports (#27855) 2025-01-30 15:34:59 +01:00
urls.rs refactor: use DataUrl from deno_media_type (#27783) 2025-01-30 15:34:52 +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.

This documentation has been moved to the Deno manual.