summaryrefslogtreecommitdiff
path: root/cli/lsp/language_server.rs
AgeCommit message (Collapse)Author
2023-12-12perf(lsp): collect counts and durations of all requests (#21540)Bartek Iwańczuk
In addition to collecting details per-request metrics of the last 3000 request this commit adds aggregate metrics for all requests.
2023-12-11perf(lsp): instrument all ops with performance marks (#21536)Bartek Iwańczuk
Adds performance measurements for all ops used by the LSP. Also changes output of "Language server status" page to include more precise information. Current suspicion is that computing "script version" takes a long time for some users.
2023-12-08feat(lsp): debug log file (#21500)Nayeem Rahman
2023-12-08feat(lsp): provide quick fixes for specifiers that could be resolved ↵David Sherret
sloppily (#21506)
2023-12-07feat: add suggestions to module not found error messages for file urls (#21498)David Sherret
2023-12-07feat(unstable): ability to resolve specifiers with no extension, specifiers ↵David Sherret
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-01refactor(lsp): log names (#21413)Bartek Iwańczuk
This commit changes LSP log names by prefixing them, we now have these prefixes: - `lsp.*` - requests coming from the client - `tsc.request.*` - requests coming from clients that are routed to TSC - `tsc.op.*` - ops called by the TS host - `tsc.host.*` - requests that call JavaScript runtime that runs TypeScript compiler host Additionall `Performance::mark` was split into `Performance::mark` and `Performance::mark_with_args` to reduce verbosity of code and logs.
2023-11-30perf(lsp): avoid redundant getNavigationTree() calls (#21396)Nayeem Rahman
2023-11-22fix(lsp): force shutdown after a timeout (#21251)Nayeem Rahman
2023-11-17refactor(upgrade): add unit tests for lsp upgrade check (#21244)David Sherret
2023-11-14feat(lsp): upgrade check on init and notification (#21105)Nayeem Rahman
2023-11-12fix(lsp): update tsconfig after refreshing settings on init (#21170)Nayeem Rahman
2023-11-04fix(node): use closest package.json to resolve package.json imports (#21075)David Sherret
2023-10-25feat(unstable): ability to `npm install` then `deno run main.ts` (#20967)David Sherret
This PR adds a new unstable "bring your own node_modules" (BYONM) functionality currently behind a `--unstable-byonm` flag (`"unstable": ["byonm"]` in a deno.json). This enables users to run a separate install command (ex. `npm install`, `pnpm install`) then run `deno run main.ts` and Deno will respect the layout of the node_modules directory as setup by the separate install command. It also works with npm/yarn/pnpm workspaces. For this PR, the behaviour is opted into by specifying `--unstable-byonm`/`"unstable": ["byonm"]`, but in the future we may make this the default behaviour as outlined in https://github.com/denoland/deno/issues/18967#issuecomment-1761248941 This is an extremely rough initial implementation. Errors are terrible in this and the LSP requires frequent restarts. Improvements will be done in follow up PRs.
2023-10-24perf(lsp): cleanup workspace settings scopes (#20937)Nayeem Rahman
2023-10-17feat(lsp): respect "typescript.preferences.quoteStyle" when deno.json is ↵Nayeem Rahman
absent (#20891)
2023-10-12feat(lsp): send "deno/didChangeDenoConfiguration" notifications (#20827)Nayeem Rahman
2023-10-12perf(lsp): fix redundant file reads (#20802)Nayeem Rahman
2023-10-10refactor(lsp): add "deno.reloadImportRegistries" as a command (#20823)Nayeem Rahman
2023-10-09fix(lsp): allow formatting vendor files (#20844)Nayeem Rahman
2023-10-09perf(lsp): optimize formatting minified files (#20829)Nayeem Rahman
2023-10-02refactor(npm): make `NpmCache`, `CliNpmRegistryApi`, and `NpmResolution` ↵David Sherret
internal to `npm::managed` (#20764)
2023-09-30refactor(npm): create `cli::npm::managed` module (#20740)David Sherret
Creates the `cli::npm::managed` module and starts moving more functionality into it.
2023-09-29refactor(cli): make `CliNpmResolver` a trait (#20732)David Sherret
This makes `CliNpmResolver` a trait. The terminology used is: - **managed** - Deno manages the node_modules folder and does an auto-install (ex. `ManagedCliNpmResolver`) - **byonm** - "Bring your own node_modules" (ex. `ByonmCliNpmResolver`, which is in this PR, but unimplemented at the moment) Part of #18967
2023-09-28refactor(ext/node): remove dependency on deno_npm and deno_semver (#20718)David Sherret
This is required from BYONM (bring your own node_modules). Part of #18967
2023-09-27fix(lsp): allow query strings for "deno:/status.md" (#20697)Nayeem Rahman
2023-09-26chore(lsp): bump tower-lsp to 0.20.0 (#20693)Nayeem Rahman
2023-09-26feat(lsp): support more vscode built-in settings (#20679)Nayeem Rahman
2023-09-24feat(lsp): cache all dependencies quick fix (#20665)Nayeem Rahman
2023-09-24fix(lsp): resolve remote import maps (#20651)Nayeem Rahman
2023-09-24refactor(lsp): implement "deno.cacheOnSave" server-side (#20632)Nayeem Rahman
2023-09-21refactor(lsp): store language sections in WorkspaceSettings (#20593)Nayeem Rahman
When sending configuration requests to the client, reads `javascript` and `typescript` sections in addition to `deno`. The LSP's initialization options now accepts `javascript` and `typescript` namespaces.
2023-09-18refactor(lsp): cleanup document preload (#20520)Nayeem Rahman
2023-09-18fix(lsp): pass quote preference to tsc (#20547)Nayeem Rahman
2023-09-16feat(lsp): include source in auto import completion label (#20523)Nayeem Rahman
2023-09-13feat(lsp): WorkspaceSettings::disablePaths (#20475)Nayeem Rahman
2023-09-10fix(lsp): always enable semantic tokens responses (#20440)Nayeem Rahman
2023-09-09fix(lsp): respect configured exclusions for testing APIs (#20427)Nayeem Rahman
LSP testing APIs now obey the various file inclusion settings: - Modules shown in the text explorer now respect the `exclude`, `test.exclude` and `test.include` fields in `deno.json`, as well as `deno.enablePaths` in VSCode settings. - Modules with testing code lens now respect the `"exclude"`, `test.exclude` and `test.include` fields in `deno.json`. Code lens already respects `deno.enablePaths`.
2023-09-09Reland "refactor(lsp): clean up "enablePaths" handling (#20388)" (#20423)Nayeem Rahman
2023-09-08Revert "refactor(lsp): clean up "enablePaths" handling (#20388)" (#20419)Nayeem Rahman
This reverts commit 4a11603c76b13ecf92ce3141ec317a42ae9f8d1d.
2023-09-08refactor(lsp): clean up "enablePaths" handling (#20388)Nayeem Rahman
Previously we pre-computed enabled paths into `Config::enabled_paths`, and had to keep updating it. Now we determine enabled paths directly from `Config::settings` on demand as a single source of truth. Removes `Config::root_uri`. If `InitializeParams::rootUri` is given, and it doesn't correspond to a folder in `InitializeParams::workspaceFolders`, prepend it to `Config::workspace_folders` as a mocked folder. Includes groundwork for https://github.com/denoland/vscode_deno/issues/908. In a minor version cycle or two we can fix that in vscode_deno, and it won't break for Deno versions post this patch due to the corrected deserialization logic for `enablePaths`.
2023-09-05feat(lsp): provide the deno.cache command server-side (#20111)sigmaSd
Co-authored-by: Nayeem Rahman <nayeemrmn99@gmail.com>
2023-09-02fix(lsp): properly handle disabled configuration requests (#20358)Nayeem Rahman
Fixes #19802. Properly respect when clients do not have the `workspace/configuration` capability, a.k.a. when an editor cannot provide scoped settings on request from the LSP. - Fix one spot where we weren't checking for the capability before sending this request. - For `enablePaths`, fall back to the settings passed in the initialization options in more cases. - Respect the `workspace/configuration` capability in the test harness client. See: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#workspace_configuration.
2023-09-01Reland "feat(lsp): enable via config file detection (#20334)" (#20349)Nayeem Rahman
2023-09-01Revert "feat(lsp): enable via config file detection (#20334)" (#20347)Bartek Iwańczuk
This reverts commit c0dcf6a3571ee04b4826c52d1329804e7c2b02c4. CC @nayeemrmn
2023-08-31feat(lsp): enable via config file detection (#20334)Nayeem Rahman
With https://github.com/denoland/vscode_deno/pull/902 for https://github.com/denoland/vscode_deno/issues/880. For multi-folder workspaces, note that this only scans the first one and applies the result to all. That means users would have to still have to specify `"deno.enable": true/false` for their secondary folders if the preference is different for those.
2023-08-29fix(lsp): recreate npm search cache when cache path changes (#20327)David Sherret
2023-08-29feat(lsp): npm specifier completions (#20121)Nayeem Rahman
2023-08-26chore: update to Rust 1.72 (#20258)林炳权
<!-- Before submitting a PR, please read https://deno.com/manual/contributing 1. Give the PR a descriptive title. Examples of good title: - fix(std/http): Fix race condition in server - docs(console): Update docstrings - feat(doc): Handle nested reexports Examples of bad title: - fix #7123 - update docs - fix bugs 2. Ensure there is a related issue and it is referenced in the PR text. 3. Ensure there are tests that cover the changes. 4. Ensure `cargo test` passes. 5. Ensure `./tools/format.js` passes without changing files. 6. Ensure `./tools/lint.js` passes. 7. Open as a draft PR if your work is still in progress. The CI won't run all steps, but you can add '[ci]' to a commit message to force it to. 8. If you would like to run the benchmarks on the CI, add the 'ci-bench' label. --> As the title. --------- Co-authored-by: Matt Mastracci <matthew@mastracci.com>
2023-08-26feat(lsp): update imports on file rename (#20245)Nayeem Rahman
Closes https://github.com/denoland/vscode_deno/issues/410.