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
David Sherret 890780a9e9
feat(unstable): ability to resolve specifiers with no extension, specifiers for a directory, and TS files from JS extensions (#21464)
Adds an `--unstable-sloppy-imports` flag which supports the
following for `file:` specifiers:

* Allows writing `./mod` in a specifier to do extension probing.
- ex. `import { Example } from "./example"` instead of `import { Example
} from "./example.ts"`
* Allows writing `./routes` to do directory extension probing for files
like `./routes/index.ts`
* Allows writing `./mod.js` for *mod.ts* files.

This functionality is **NOT RECOMMENDED** for general use with Deno:

1. It's not as optimal for perf:
https://marvinh.dev/blog/speeding-up-javascript-ecosystem-part-2/
1. It makes tooling in the ecosystem more complex in order to have to
understand this.
1. The "Deno way" is to be explicit about what you're doing. It's better
in the long run.
1. It doesn't work if published to the Deno registry because doing stuff
like extension probing with remote specifiers would be incredibly slow.

This is instead only recommended to help with migrating existing
projects to Deno. For example, it's very useful for getting CJS projects
written with import/export declaration working in Deno without modifying
module specifiers and for supporting TS ESM projects written with
`./mod.js` specifiers.

This feature will output warnings to guide the user towards correcting
their specifiers. Additionally, quick fixes are provided in the LSP to
update these specifiers:
2023-12-07 00:03:18 +00:00
..
testing refactor(lsp): log names (#21413) 2023-12-01 03:54:59 +01:00
analysis.rs fix(node): use closest package.json to resolve package.json imports (#21075) 2023-11-04 16:41:51 +00:00
cache.rs feat(unstable): optional deno_modules directory (#19977) 2023-08-02 00:49:09 +00:00
capabilities.rs refactor(lsp): add "deno.reloadImportRegistries" as a command (#20823) 2023-10-10 05:53:41 +01:00
client.rs feat(lsp): upgrade check on init and notification (#21105) 2023-11-14 22:10:51 +00:00
code_lens.rs perf(lsp): avoid redundant getNavigationTree() calls (#21396) 2023-11-30 16:23:47 +00:00
completions.rs fix(lsp): handle byonm specifiers in jupyter notebooks (#21332) 2023-11-24 17:35:33 -05:00
config.rs perf(lsp): avoid redundant getNavigationTree() calls (#21396) 2023-11-30 16:23:47 +00:00
diagnostics.rs feat(unstable): ability to resolve specifiers with no extension, specifiers for a directory, and TS files from JS extensions (#21464) 2023-12-07 00:03:18 +00:00
documents.rs feat(unstable): ability to resolve specifiers with no extension, specifiers for a directory, and TS files from JS extensions (#21464) 2023-12-07 00:03:18 +00:00
language_server.rs feat(unstable): ability to resolve specifiers with no extension, specifiers for a directory, and TS files from JS extensions (#21464) 2023-12-07 00:03:18 +00:00
logging.rs feat(lsp): upgrade check on init and notification (#21105) 2023-11-14 22:10:51 +00:00
lsp_custom.rs feat(lsp): upgrade check on init and notification (#21105) 2023-11-14 22:10:51 +00:00
mod.rs fix(lsp): force shutdown after a timeout (#21251) 2023-11-22 04:08:48 +00:00
npm.rs refactor(npm): make NpmCache, CliNpmRegistryApi, and NpmResolution internal to npm::managed (#20764) 2023-10-02 17:53:55 -04: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 perf(lsp): better op performance logging (#21423) 2023-12-01 22:57:52 +01:00
README.md docs: fix broken deno manual link (#20667) 2023-09-25 14:09:27 +02:00
refactor.rs refactor(lsp): fewer clones (#17551) 2023-01-26 23:24:03 +01:00
registries.rs fix(lsp): don't commit registry completions on "/" (#20902) 2023-10-13 14:38:34 +01:00
repl.rs fix(lsp): force shutdown after a timeout (#21251) 2023-11-22 04:08:48 +00:00
semantic_tokens.rs chore: use rustfmt imports_granularity option (#17421) 2023-01-14 23:18:58 -05:00
text.rs perf(lsp): optimize formatting minified files (#20829) 2023-10-09 04:39:52 +01:00
tsc.rs feat(unstable): ability to resolve specifiers with no extension, specifiers for a directory, and TS files from JS extensions (#21464) 2023-12-07 00:03:18 +00:00
urls.rs fix(lsp): handle byonm specifiers in jupyter notebooks (#21332) 2023-11-24 17:35:33 -05: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.