summaryrefslogtreecommitdiff
path: root/cli/lsp/language_server.rs
AgeCommit message (Collapse)Author
2024-03-26refactor(lsp): unify config file data into ConfigTree (#23032)Nayeem Rahman
2024-03-21feat(lint): `deno lint --fix` and lsp quick fixes (#22615)David Sherret
Adds a `--fix` option to deno lint. This currently doesn't work for basically any rules, but we can add them over time to deno lint.
2024-03-21refactor(lsp): factor out workspace walk from resolver update (#22937)Nayeem Rahman
2024-03-11chore: enable clippy unused_async rule (#22834)David Sherret
2024-03-06feat(unstable/pm): support npm packages in 'deno add' (#22715)Nayeem Rahman
2024-03-06fix(node): improve cjs tracking (#22673)David Sherret
We were missing saying that a file is CJS when some Deno code imported from the node_modules directory at runtime.
2024-03-04feat(lsp): include registry url in jsr import hover text (#22676)Nayeem Rahman
2024-03-01fix(lsp): output more information on error (#22665)David Sherret
2024-03-01fix(lsp): regression - caching in lsp broken when config with imports has ↵David Sherret
comments (#22666) Caused by https://github.com/denoland/deno/pull/22553 Closes #22664
2024-02-29feat(lsp): jsr specifier completions (#22612)Nayeem Rahman
2024-02-27feat(publish): discover jsr.json and jsr.jsonc files (#22587)Bartek Iwańczuk
Closes https://github.com/denoland/deno/issues/22491
2024-02-24fix(lsp): import map expansion (#22553)David Sherret
2024-02-20perf(jsr): fast check cache and lazy fast check graph (#22485)David Sherret
2024-02-14feat(lsp): jsr support with cache probing (#22418)Nayeem Rahman
2024-02-12feat(lsp): jsr support first pass (#22382)Nayeem Rahman
This implementation heavily depends on there being a lockfile, meaning JSR specifiers will always diagnose as uncached unless it's there. In practice this affects cases where a `deno.json` isn't being used. Our NPM specifier support isn't subject to this. The reason for this is that the version constraint solving code is currently buried in `deno_graph` and not usable from the LSP, so the only way to reuse that logic is the solved-version map in the lockfile's `packages.specifiers`.
2024-01-30fix(lsp): don't normalize urls in cache command params (#22182)Nayeem Rahman
2024-01-28chore(lsp): rename client-side command invocations (#22140)Nayeem Rahman
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)