summaryrefslogtreecommitdiff
path: root/cli/lsp/language_server.rs
AgeCommit message (Collapse)Author
2023-08-23fix(ext/web): add stream tests to detect v8slice split bug (#20253)Matt Mastracci
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-08-17fix(lsp): pass fmt options to completion requests (#20184)Nayeem Rahman
Fixes https://github.com/denoland/vscode_deno/issues/856.
2023-08-08refactor(cli): move `snapshot_from_lockfile` function to `deno_npm` (#20024)Yusuke Tanaka
This commit moves `snapshot_from_lockfile` function to [deno_npm crate](https://github.com/denoland/deno_npm). This allows this function to be called outside Deno CLI (in particular, Deno Deploy).
2023-08-08refactor: use deno_cache_dir crate (#20092)David Sherret
Uses https://github.com/denoland/deno_cache/pull/26
2023-08-06feat(unstable): rename `deno_modules` to `vendor` (#20065)David Sherret
Renames the unstable `deno_modules` directory and corresponding settings to `vendor` after feedback. Also causes the vendoring of the `node_modules` directory which can be disabled via `--node-modules-dir=false` or `"nodeModulesDir": false`.
2023-08-02feat(unstable/lsp): support navigating to deno_modules folder (#20030)David Sherret
Closes #20015 Closes https://github.com/denoland/vscode_deno/issues/850 (only for deno_modules, but I don't think this will be possible for the global cache)
2023-08-02fix: make "suggest.autoImports" to switch completions from external modules ↵Kyoh
(#19845)
2023-08-02feat(unstable): optional `deno_modules` directory (#19977)David Sherret
Closes #15633
2023-07-26fix(lsp): handle import mapped `node:` specifier (#19956)David Sherret
Closes https://github.com/denoland/vscode_deno/issues/805
2023-07-21fix(lsp): handle watched files events from symlinked config files (#19898)David Sherret
Related to https://github.com/denoland/vscode_deno/issues/784
2023-07-20fix(lsp): auto-discover deno.json in more cases (#19894)David Sherret
We weren't auto-discovering the deno.json in two cases: 1. A project that didn't have a deno.json and just added one. 2. After a syntax error in the deno.json. This now rediscovers it in both these cases. Closes https://github.com/denoland/vscode_deno/issues/867
2023-07-20perf(lsp): format in a blocking task (#19883)David Sherret
2023-07-10refactor(lsp): move config file related code to config.rs (#19790)David Sherret
Will make #19788 easier.
2023-07-08refactor: abstract away file system to be buried inside HttpCache (#19760)David Sherret
This improves the HttpCache to make it being stored on the file system an implementation detail.
2023-07-03feat(lsp): support import maps in quick fix and auto-imports (#19692)David Sherret
Closes https://github.com/denoland/vscode_deno/issues/849 Closes #15330 Closes #10951 Closes #13623
2023-07-02feat(lsp): basic support of auto-imports for npm specifiers (#19675)David Sherret
Closes #19625 Closes https://github.com/denoland/vscode_deno/issues/857
2023-07-02Reland "fix(cli): don't store blob and data urls in the module cache" (#18581)Nayeem Rahman
Relands #18261 now that https://github.com/lucacasonato/esbuild_deno_loader/pull/54 is landed and used by fresh. Fixes #18260.
2023-06-26chore: fix typos (#19572)Martin Fischer
2023-06-13fix(lsp): update import map config when deno.json changes (#19476)David Sherret
Half of #19468
2023-06-10chore(tests): test_util - Add `PathRef` (#19450)David Sherret
This adds a new `PathRef` struct to test_util for making it easier to work with paths in test code. I'm going to expand on this more in the future.
2023-06-08refactor(compile): store the npm snapshot in the eszip (#19343)David Sherret
2023-06-06perf(cli): conditionally load typescript declaration files (#19392)David Sherret
Closes #18583
2023-05-26chore(lsp/tests): diagnostic synchronization (reland) (#19270)David Sherret
Merge on approval as it fixes the flaky test.
2023-05-26Revert "chore(lsp/tests): diagnostic synchronization (#19264)" (#19268)Bartek Iwańczuk
This reverts commit 89026abe395c22eb2ace4ea5f948189daa1dadf1. This change caused LSP benchmarks to fail on `main`.
2023-05-26chore(lsp/tests): diagnostic synchronization (#19264)David Sherret
Fixes the flaky lsp test by having better synchronization of diagnostics between the client and server for testing purposes.
2023-05-25fix(compile): handle when DENO_DIR is readonly (#19257)David Sherret
Closes #19253
2023-05-22feat(lsp): support lockfile and node_modules directory (#19203)David Sherret
This adds support for the lockfile and node_modules directory to the lsp. In the case of the node_modules directory, it is only enabled when explicitly opted into via `"nodeModulesDir": true` in the configuration file. This is to reduce the language server automatically modifying the node_modules directory when the user doesn't want it to. Closes #16510 Closes #16373
2023-05-22fix(npm): store npm binary command resolution in lockfile (#19219)David Sherret
Part of #19038 Closes #19034 (eliminates the time spent re-resolving)
2023-05-17fix(npm): improved optional dependency support (#19135)David Sherret
Note: If the package information has already been cached, then this requires running with `--reload` or for the registry information to be fetched some other way (ex. the cache busting). Closes #15544 --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-05-14refactor(core): bake single-thread assumptions into spawn/spawn_blocking ↵Matt Mastracci
(#19056) Partially supersedes #19016. This migrates `spawn` and `spawn_blocking` to `deno_core`, and removes the requirement for `spawn` tasks to be `Send` given our single-threaded executor. While we don't need to technically do anything w/`spawn_blocking`, this allows us to have a single `JoinHandle` type that works for both cases, and allows us to more easily experiment with alternative `spawn_blocking` implementations that do not require tokio (ie: rayon). Async ops (+~35%): Before: ``` time 1310 ms rate 763358 time 1267 ms rate 789265 time 1259 ms rate 794281 time 1266 ms rate 789889 ``` After: ``` time 956 ms rate 1046025 time 954 ms rate 1048218 time 924 ms rate 1082251 time 920 ms rate 1086956 ``` HTTP serve (+~4.4%): Before: ``` Running 10s test @ http://localhost:4500 2 threads and 10 connections Thread Stats Avg Stdev Max +/- Stdev Latency 68.78us 19.77us 1.43ms 86.84% Req/Sec 68.78k 5.00k 73.84k 91.58% 1381833 requests in 10.10s, 167.36MB read Requests/sec: 136823.29 Transfer/sec: 16.57MB ``` After: ``` Running 10s test @ http://localhost:4500 2 threads and 10 connections Thread Stats Avg Stdev Max +/- Stdev Latency 63.12us 17.43us 1.11ms 85.13% Req/Sec 71.82k 3.71k 77.02k 79.21% 1443195 requests in 10.10s, 174.79MB read Requests/sec: 142921.99 Transfer/sec: 17.31MB ``` Suggested-By: alice@ryhl.io Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-05-12refactor(lsp): make `RequestMethod` private (#19114)David Sherret
2023-05-11feat(lsp): ability to configure document pre-load limit (#19097)David Sherret
Adds a `deno.preloadLimit` option (ex. `"deno.preloadLimit": 2000`) which specifies how many file entries to traverse on the file system when the lsp loads or its configuration changes. Closes #18955
2023-05-11fix(lsp): hard to soft error when unable to get completion info (#19091)David Sherret
2023-05-10feat(compile): unstable npm and node specifier support (#19005)David Sherret
This is the initial support for npm and node specifiers in `deno compile`. The npm packages are included in the binary and read from it via a virtual file system. This also supports the `--node-modules-dir` flag, dependencies specified in a package.json, and npm binary commands (ex. `deno compile --unstable npm:cowsay`) Closes #16632
2023-05-05refactor(ext/node): combine `deno_node::Fs` with `deno_fs::FileSystem` (#18991)David Sherret
2023-05-01perf: lazily create RootCertStore (#18938)David Sherret
2023-05-01refactor(cli): remove ProcState - add CliFactory (#18900)David Sherret
This removes `ProcState` and replaces it with a new `CliFactory` which initializes our "service structs" on demand. This isn't a performance improvement at the moment for `deno run`, but might unlock performance improvements in the future.
2023-04-26refactor(compile): remove usage of ProcState and CliOptions (#18855)David Sherret
2023-04-24refactor(ext/node): allow injecting `NodeFs` from CLI (#18829)David Sherret
This allows providing a `NodeFs` as part of the `WorkerOptions`.
2023-04-21refactor(node): move most of cli/node to ext/node (#18797)David Sherret
This is just a straight refactor and I didn't do any cleanup in ext/node. After this PR we can start to clean it up and make things private that don't need to be public anymore.
2023-04-17refactor(npm): add CliNodeResolver (#18742)David Sherret
2023-04-14refactor: break up `ProcState` (#18707)David Sherret
1. Breaks up functionality within `ProcState` into several other structs to break out the responsibilities (`ProcState` is only a data struct now). 2. Moves towards being able to inject dependencies more easily and have functionality only require what it needs. 3. Exposes `Arc<T>` around the "service structs" instead of it being embedded within them. The idea behind embedding them was to reduce the verbosity of needing to pass around `Arc<...>`, but I don't think it was exactly working and as we move more of these structs to be more injectable I don't think the extra verbosity will be a big deal.
2023-04-13refactor: upgrade to deno_npm 0.3.0 (#18671)David Sherret
This allows us to specify the `@types/node` version constraint in the CLI instead of in deno_npm.
2023-04-12refactor: `ProcState::build` -> `ProcState::from_flags` (#18672)David Sherret
2023-04-12fix(npm): cache bust npm specifiers more aggressively (#18636)David Sherret
Part 1: #18622 Part 2: This PR Closes #16901 --------- Co-authored-by: Luca Casonato <hello@lcas.dev>
2023-04-06refactor(npm): use deno_npm and deno_semver (#18602)David Sherret
2023-04-01fix(lsp): add a document preload file system entry limit (#18553)David Sherret
I was testing this out and it's badly needed. For now, it's not configurable and limited to 1,000 file system entries. Related to #18538
2023-04-01fix(repl): disable language server document preloading in the repl (#18543)David Sherret
This was an oversight because the repl uses the language server under the hood. Also, never preloads from a root directory. Part of #18538
2023-03-30fix(lsp): include all diagnosable documents on initialize (#17979)David Sherret
Closes https://github.com/denoland/vscode_deno/issues/797 Closes https://github.com/denoland/deno/issues/11190 Closes https://github.com/denoland/vscode_deno/issues/811 Closes https://github.com/denoland/vscode_deno/issues/761 Closes https://github.com/denoland/vscode_deno/issues/585 Closes https://github.com/denoland/vscode_deno/issues/561 Closes https://github.com/denoland/vscode_deno/issues/410
2023-03-30fix(lsp): `textDocument/references` should respect `includeDeclaration` (#18496)David Sherret