summaryrefslogtreecommitdiff
path: root/cli/lsp/language_server.rs
AgeCommit message (Collapse)Author
2023-03-30fix(repl): improve package.json support (#18497)David Sherret
1. Fixes a cosmetic issue in the repl where it would display lsp warning messages. 2. Lazily loads dependencies from the package.json on use. 3. Supports using bare specifiers from package.json in the REPL. Closes #17929 Closes #18494
2023-03-29refactor(lsp): remove boolean parameters on `documents.documents(...)` (#18493)David Sherret
I think this makes things clearer at the call sites.
2023-03-23refactor(lsp): add `LspClientUrl` (#18376)David Sherret
This will make it a bit harder to accidentally use a client url in the wrong place. I don't fully understand why we do this mapping, but this will help prevent bugs like #18373 Closes #18374
2023-03-23fix(lsp): ensure `enablePaths` works when clients do not provide a trailing ↵David Sherret
slash for workspace dir (#18373) Closes https://github.com/denoland/vscode_deno/issues/827
2023-03-21feat: TypeScript 5.0.2 (except decorators) (#18294)David Sherret
This upgrades TypeScript to 5.0.2, but does not have ES decorator support because swc does not support that yet.
2023-03-15refactor: remove usages of `map_or` / `map_or_else` (#18212)David Sherret
These methods are confusing because the arguments are backwards. I feel like they should have never been added to `Option<T>` and that clippy should suggest rewriting to `map(...).unwrap_or(...)`/`map(...).unwrap_or_else(|| ...)` https://github.com/rust-lang/rfcs/issues/1025
2023-03-15fix(lsp): avoid calling client while holding lock (#18197)David Sherret
2023-03-13fix(npm): show a progress bar when initializing the node_modules folder (#18136)David Sherret
Creating the node_modules folder when the packages are already downloaded can take a bit of time and not knowing what is going on can be confusing. It's better to show a progress bar.
2023-03-12refactor(npm): push npm struct creation to a higher level (#18139)David Sherret
This has been bothering me for a while and it became more painful while working on #18136 because injecting the shared progress bar became very verbose. Basically we should move the creation of all these npm structs up to a higher level. This is a stepping stone for a future refactor where we can improve how we create all our structs.
2023-03-11fix(check): regression where config "types" entries caused type checking ↵David Sherret
errors (#18124) Closes #18117 Closes #18121 (this is just over 10ms faster in a directory one up from the root folder) cc @nayeemrmn
2023-02-23fix(npm): allow resolving from package.json when an import map exists (#17905)David Sherret
2023-02-23feat(npm): support bare specifiers from package.json in more subcommands and ↵David Sherret
language server (#17891)
2023-02-22fix(npm): resolve node_modules dir relative to package.json instead of cwd ↵David Sherret
(#17885)
2023-02-22feat: support bare specifier resolution with package.json (#17864)Bartek Iwańczuk
This commit enables resolution of "bare specifiers" (eg. "import express from 'express';") if a "package.json" file is discovered. It's a step towards being able to run projects authored for Node.js without any changes. With this commit we are able to successfully run Vite projects without any changes to the user code. --------- Co-authored-by: David Sherret <dsherret@gmail.com>
2023-02-22refactor: use deno_graph for npm specifiers (#17858)David Sherret
This changes npm specifiers to be handled by deno_graph and resolved to an npm package name and version when the specifier is encountered. It also slightly changes how npm specifier resolution occurs—previously it would collect all the npm specifiers and resolve them all at once, but now it resolves them on the fly as they are encountered in the module graph. https://github.com/denoland/deno_graph/pull/232 --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-02-21fix(npm): improve peer dependency resolution (#17835)David Sherret
This PR fixes peer dependency resolution to only resolve peers based on the current graph traversal path. Previously, it would resolve a peers by looking at a graph node's ancestors, which is not correct because graph nodes are shared by different resolutions. It also stores more information about peer dependency resolution in the lockfile.
2023-02-20feat: auto-discover package.json for npm dependencies (#17272)Bartek Iwańczuk
This commits adds auto-discovery of "package.json" file when running "deno run" and "deno task" subcommands. In case of "deno run" the "package.json" is being looked up starting from the directory of the script that is being run, stopping early if "deno.json(c)" file is found (ie. FS tree won't be traversed "up" from "deno.json"). When "package.json" is discovered the "--node-modules-dir" flag is implied, leading to creation of local "node_modules/" directory - we did that, because most tools relying on "package.json" will expect "node_modules/" directory to be present (eg. Vite). Additionally "dependencies" and "devDependencies" specified in the "package.json" are downloaded on startup. This is a stepping stone to supporting bare specifier imports, but the actual integration will be done in a follow up commit. --------- Co-authored-by: David Sherret <dsherret@gmail.com>
2023-02-15refactor: make resolver required (#17783)David Sherret
Makes the resolver required and prints a warning when vendoring and a dynamic import can't be resolved. Closes #16522
2023-02-09refactor: deno_graph 0.43 upgrade (#17692)David Sherret
2023-02-06fix: revert lsp related internal specifiers (#17673)Leo Kettmeir
To fix reports of breakage from #17655
2023-02-05 refactor: rename `deno` specifiers to `internal` (#17655)Leo Kettmeir
2023-01-28fix(lsp): update document dependencies on configuration change (#17556)David Sherret
2023-01-27chore: upgrade to Rust 1.67 (#17548)David Sherret
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-01-26refactor(lsp): fewer clones (#17551)Geert-Jan Zwiers
2023-01-25fix: support import map specified as data uri (#17531)David Sherret
2023-01-25feat: embed import map in the config file (#17478)Bartek Iwańczuk
This commit changes handling of config file to enable specifying "imports" and "scopes" objects effectively making the configuration file an import map. "imports" and "scopes" take precedence over "importMap" configuration, but have lower priority than "--importmap" CLI flag. Co-authored-by: David Sherret <dsherret@users.noreply.github.com> Co-authored-by: David Sherret <dsherret@gmail.com>
2023-01-24feat: suggest adding a "node:" prefix for bare specifiers that look like ↵David Sherret
built-in Node modules (#17519)
2023-01-24refactor(deno_graph): remove unused Resolved::Ok#kind usage (#17504)David Sherret
See https://github.com/denoland/deno_graph/pull/205 for more details.
2023-01-18refactor(cli): Integrate standalone mode cert handling into `Flags` (#17419)Andreu Botella
The way the standalone mode handles the `--cert` flag is different to all other modes. This is because `--cert` takes a path to the certificate file, which is directly added to the root cert store; except for compile mode, where its byte contents are stored in the standalone metadata, and they are added to the root cert store after the `ProcState` is created. This change instead changes `Flags::ca_file` (an `Option<String>`) into `Flags::ca_data`, which can represent a `String` file path or a `Vec<u8>` with the certificate contents. That way, standalone mode can create a `ProcState` whose root cert store alreay contains the certificate. This change also adds a tests for certificates in standalone mode, since there weren't any before. This refactor will help with implementing web workers in standalone mode in the future.
2023-01-07refactor(cli/tools): move flag and config logic to CliOptions (#17008)Geert-Jan Zwiers
Co-authored-by: David Sherret <dsherret@gmail.com>
2023-01-03fix(lsp): don't error if completionItem/resolve request fails (#17250)Bartek Iwańczuk
2023-01-03refactor(lsp): reduce number of clones (#17254)Geert-Jan Zwiers
This PR optimizes the code in the language server by performing less cloning of data.
2023-01-02chore: update copyright year to 2023 (#17247)David Sherret
Yearly tradition of creating extra noise in git.
2022-12-20fix(lsp/format): language formatter used should be based on language id (#17148)David Sherret
Closes #11897
2022-12-19perf(lsp): concurrent reads and exclusive writes (#17135)David Sherret
2022-12-12feat: improve download progress bar (#16984)Bartek Iwańczuk
Co-authored-by: David Sherret <dsherret@gmail.com>
2022-11-28refactor: create util folder, move nap_sym to napi/sym, move http_cache to ↵David Sherret
cache folder (#16857)
2022-11-27fix(npm): ensure npm package downloaded once per run when using `--reload` ↵David Sherret
(#16842)
2022-11-26refactor: `DenoDir` - move to cache folder and make `root_dir` private (#16823)David Sherret
2022-11-18fix(npm): use an http client with connection pool (#16705)David Sherret
Should make downloading npm packages faster and more reliable.
2022-11-10feat: remove --unstable flag requirement for npm: specifiers (#16473)Bartek Iwańczuk
This commit makes "npm:" specifiers not require "--unstable" flag. At the moment some APIs used by Node polyfills still require "--unstable" which will be addressed in follow up PRs.
2022-11-08feat(unstable/npm): support peer dependencies (#16561)David Sherret
This adds support for peer dependencies in npm packages. 1. If not found higher in the tree (ancestor and ancestor siblings), peer dependencies are resolved like a dependency similar to npm 7. 2. Optional peer dependencies are only resolved if found higher in the tree. 3. This creates "copy packages" or duplicates of a package when a package has different resolution due to peer dependency resolution—see https://pnpm.io/how-peers-are-resolved. Unlike pnpm though, duplicates of packages will have `_1`, `_2`, etc. added to the end of the package version in the directory in order to minimize the chance of hitting the max file path limit on Windows. This is done for both the local "node_modules" directory and also the global npm cache. The files are hard linked in this case to reduce hard drive space. This is a first pass and the code is definitely more inefficient than it could be. Closes #15823
2022-11-02fix(lock): autodiscovery of lockfile (#16498)Bartek Iwańczuk
This commit adds autodiscovery of lockfile. This only happens if Deno discovers the configuration file (either "deno.json" or "deno.jsonc"). In such case Deno tries to load "deno.lock" file that sits next to the configuration file, or creates one for user if the lockfile doesn't exist yet. As a consequence, "--lock" and "--lock-write" flags had been updated. "--lock" no longer requires a value, if one is not provided, it defaults to "./deno.lock" resolved from the current working directory. "--lock-write" description was updated to say that it forces to overwrite a lockfile. Autodiscovery is currently not handled by the LSP.
2022-10-21feat(unstable/npm): initial type checking of npm specifiers (#16332)David Sherret
2022-10-20fix(lsp): allow caching deps in non-saved files (#16353)David Sherret
2022-10-17fix(lsp): treat empty import map value config as none (#16224)Tomofumi Chiba
Ref: denoland/vscode_deno#718 Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2022-10-16feat: support inlay hints (#16287)Kitson Kelly
Closes: #11853
2022-10-14fix(lsp): properly handle snippets on completions (#16274)Kitson Kelly
Fixes #15367
2022-08-02fix(lsp): remove excessive line breaks in status page (#15364)Outvi V
Fixes #15359
2022-07-14feat(lsp): provide import map remapping diags and fixes (#15165)Kitson Kelly