summaryrefslogtreecommitdiff
path: root/cli/lsp/language_server.rs
AgeCommit message (Collapse)Author
2024-01-25fix(lsp): disable experimentalDecorators by default (#22101)Bartek Iwańczuk
Follow up to https://github.com/denoland/deno/pull/22040. By mistake I forgot to disable "experimental decorators" in the LSP.
2024-01-23feat(lsp): include scope uri in "deno/didChangeDenoConfiguration" (#22002)Nayeem Rahman
2024-01-18fix(lsp): regression - formatting was broken on windows (#21972)David Sherret
~~Waiting on: https://github.com/denoland/deno_config/pull/31~~ Closes #21971 Closes https://github.com/denoland/vscode_deno/issues/1029
2024-01-17feat(lsp): send "deno/didChangeDenoConfiguration" on init (#21965)Nayeem Rahman
2024-01-14feat: remove conditional unstable type-checking (#21825)Bartek Iwańczuk
This commit removes conditional type-checking of unstable APIs. Before this commit `deno check` (or any other type-checking command and the LSP) would error out if there was an unstable API in the code, but not `--unstable` flag provided. This situation hinders DX and makes it harder to configure Deno. Failing during runtime unless `--unstable` flag is provided is enough in this case.
2024-01-11refactor(lsp): store project version on documents (#21892)Nayeem Rahman
2024-01-08perf: skip expanding exclude globs (#21817)David Sherret
We were calling `expand_glob` on our excludes, which is very expensive and unnecessary because we can pattern match while traversing instead. 1. Doesn't expand "exclude" globs. Instead pattern matches while walking the directory. 2. Splits up the "include" into base paths and applicable file patterns. This causes less pattern matching to occur because we're only pattern matching on patterns that might match and not ones in completely unrelated directories.
2024-01-02feat(lsp): cache jsxImportSource automatically (#21687)Nayeem Rahman
2024-01-01chore: update copyright to 2024 (#21753)David Sherret
2023-12-28perf(lsp): use LanguageServiceHost::getProjectVersion() (#21719)Nayeem Rahman
2023-12-22feat(lsp): allow to connect V8 inspector (#21482)Bartek Iwańczuk
This commit adds a way to connect to the TS compiler host that is run as part of the "deno lsp" subcommand. This can be done by specifying "DENO_LSP_INSPECTOR" variable. --------- Co-authored-by: Nayeem Rahman <nayeemrmn99@gmail.com>
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