Commit graph

663 commits

Author SHA1 Message Date
Kitson Kelly 59237d195f
feat(cli): upgrade to TypeScript 4.3 (#9960) 2021-05-28 09:33:11 +10:00
Yusuke Tanaka 02a4e7dc7c
feat(lsp): show hints from deno_lint in addition to messages (#10739) 2021-05-26 08:15:09 +10:00
Kitson Kelly cd4194a5e4
feat(lsp): diagnostics for deno types and triple-slash refs (#10699)
Fixes #9823
2021-05-25 12:34:01 +10:00
Kitson Kelly 014d8d51c0
fix(lsp): re-enable the per resource configuration without a deadlock (#10625)
Fixes #10603
2021-05-20 19:56:48 +10:00
Kitson Kelly 91decbfabf
fix(#10695): deps diagnostics include data property (#10696)
Fixes #10695
2021-05-19 22:28:23 +10:00
Satya Rohith 19e4080fa2
fix(lsp): make failed to load config error descriptive (#10685) 2021-05-18 16:48:11 -04:00
Kitson Kelly 12bfdef62c
feat(lsp): provide X-Deno-Warning as a diagnostic (#10680)
Closes #9932
2021-05-18 20:19:52 +10:00
Satya Rohith d69a5fbe1a
feat(lsp): support formatting json and markdown files (#10180)
Resolves #9447
Resolves #9415
2021-05-18 16:35:46 +10:00
Kitson Kelly 27e7bb090e
refactor: share test harness for lsp between bench and integration (#10659) 2021-05-18 06:45:13 +10:00
Luca Casonato 5151afa123
fix: static import permissions in dynamic imports
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2021-05-17 09:45:54 +02:00
Yusuke Tanaka 24a2e1ef82
docs(cli/dts): fix link from master to main (#10633) 2021-05-15 16:22:45 +09:00
Niclas Overby 608c7d68e2
fix(lsp): remove duplicate cwd in config path (#10620) 2021-05-13 23:56:30 +02:00
Kitson Kelly 0e17f086ce
fix(#10603): revert minimal changes to resolve deadlock bug (#10605) 2021-05-12 13:10:06 +10:00
Kitson Kelly 41a3b17de4
fix(lsp): remove code_action/diagnostics deadlock (#10555)
Landed without test to meet 1.10.0 deadline. See #10587.
2021-05-11 10:43:00 -04:00
Kitson Kelly 81f8585643
feat(lsp): add internal debugging logging (#10438)
Ref: #10368
2021-05-11 14:54:10 +10:00
Bartek Iwańczuk c44e53a5b6
chore: upgrade crates (#10559) 2021-05-10 22:39:16 +02:00
Elias Sjögreen f12b82e183
fix(cli): typings for Deno.os.arch (#10541) 2021-05-10 16:12:42 -04:00
Bartek Iwańczuk ce48b32979
refactor(cli): replace loading file for --config flag with generic structure (#10481)
Currently file passed to --config file is parsed using TsConfig structure
that does multiple things when loading the file. Instead of relying on that
structure I've introduced ConfigFile structure that can be updated to
sniff out more fields from the config file in the future.
2021-05-10 18:16:39 +02:00
Kitson Kelly 84733d90c7
feat: support workspace folders configuration (#10488)
Ref #8643
2021-05-10 11:16:04 +10:00
Kitson Kelly c709f5df36
refactor(lsp): publish diagnostics independently (#10525)
Resolves #10518
2021-05-07 21:05:32 +10:00
Aaron O'Mullan 1e8e44f4c3
refactor(ops): replace ZeroCopyBuf arg by 2nd generic deserializable arg (#10448) 2021-05-06 19:32:03 +02:00
Aaron O'Mullan 89057529bc
clean(cli): prefix all op functions with op_ (#10463)
Makes the codebase more searchable and helps distinguish op functions from helper functions

Besides tests/examples/benches this pattern appears to be used everywhere else in the codebase
2021-05-02 08:29:19 -04:00
Liam Murphy be287ff6a1
fix(console): Remove console.timeStamp from types (#10455)
Fixes #10444
2021-05-01 06:41:38 -04:00
Satya Rohith f60373e0d1
chore(lsp): remove dead code (#10409) 2021-04-28 14:36:23 -04:00
Satya Rohith 7063e449f1
fix(#10362): include range for export statements (#10369)
Fixes #10362
2021-04-26 06:59:18 +10:00
Aaron O'Mullan 83bece56b0
refactor(core): move op cache sync responsibility to rust space (#10340)
Even if bootstrapping the JS runtime is low level, it's an abstraction leak of 
core to require users to call `Deno.core.ops()` in JS space.

So instead we're introducing a `JsRuntime::sync_ops_cache()` method, 
once we have runtime extensions a new runtime will ensure the ops 
cache is setup (for the provided extensions) and then loading/unloading 
plugins should be the only operations that require op cache syncs
2021-04-25 22:00:05 +02:00
Satya Rohith 13f7592b8a
refactor: use 'data-url' crate to process data URLs in lsp & file_fetcher (#10196)
Closes: #10118
2021-04-23 20:43:13 +02:00
Ryan Dahl 2400ecbe16
Use ubuntu-latest-xl on more CI jobs (#10322) 2021-04-23 12:11:23 -04:00
Jean Pierre 572ec4a0a7
fix(lsp): document symbol performance mark (#10264) 2021-04-21 12:41:24 +10:00
Kitson Kelly 115197ffb0
fix(#10031): lsp handles x-typescript-types header on type only imports properly (#10261) 2021-04-20 22:22:22 +10:00
Jean Pierre 2079da0f1c
feat(lsp): Implement textDocument/documentSymbol (#9981)
Co-authored-by: Kitson Kelly <me@kitsonkelly.com>
2021-04-20 11:29:27 +10:00
Jean Pierre 6d404ec54b
feat(lsp): Implement textDocument/semanticTokens/full (#10233)
Co-authored-by: Kitson Kelly <me@kitsonkelly.com>
2021-04-20 11:26:36 +10:00
Kitson Kelly fe8057105e
fix(#10125): remove documents when closed in the lsp (#10254)
Fixes #10125
2021-04-20 07:11:23 +10:00
Kitson Kelly 65f7a021f0
feat(lsp): improve diagnostic status page (#10253) 2021-04-20 07:10:43 +10:00
Jean Pierre 65a2a04d3b
feat(lsp): implement textDocument/prepareCallHierarchy (#10061) 2021-04-19 15:11:26 +10:00
Aaron O'Mullan 204b699be4
chore(cli/lsp): fix 2 lint errors (#10228)
1. error: called `.iter().count()` on a `Vec`
2. error: inconsistent struct constructor
2021-04-18 15:29:37 +10:00
Aaron O'Mullan 46b1c653c0
refactor(deno): remove concept of bin & json ops (#10145) 2021-04-12 15:55:05 -04:00
crowlKats fefe93c91b
feat(runtime/permissions): prompt fallback (#9376)
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2021-04-12 11:15:43 +09:00
Nayeem Rahman 8aa0d5f96e
feat: set useDefineForClassFields to true (#10119)
Fixes: #9773
2021-04-11 07:56:40 +10:00
Luca Casonato 1aeabce134
chore: improve lsp registry validations (#10096) 2021-04-10 02:37:42 +02:00
Kitson Kelly d9d4a5d73c
feat(lsp): add registry import auto-complete (#9934) 2021-04-09 11:27:27 +10:00
Kitson Kelly 1ed9512022
fix(lsp): normalize windows file URLs properly (#10034)
Fixes: #9744
Fixes: https://github.com/denoland/vscode_deno/issues/386
2021-04-09 09:36:32 +10:00
Kitson Kelly 26c8d824d1
fix(lsp): don't error on tsc debug failures for code actions (#10047)
Resolves: #9913
2021-04-07 19:47:31 +10:00
Kitson Kelly 2c86ca1d64
fix(lsp): properly handle encoding URLs from lsp client (#10033)
Fixes #9741
2021-04-06 21:45:53 +10:00
Kitson Kelly 2c52c0a145
fix(lsp): folding range adjustment panic (#10030)
Fixes #10029
2021-04-06 13:27:27 +10:00
Jean Pierre 035f7b0ca0
feat(lsp): implement textDocument/foldingRange (#9900)
Co-authored-by: Kitson Kelly <me@kitsonkelly.com>
2021-04-02 17:21:07 +11:00
Kitson Kelly ec6317e894
fix(lsp): ensure insert_text is passed back on completions (#9951)
Fixes #9920
2021-04-01 20:18:51 +11:00
Aaron O'Mullan fec1b2a5a4
refactor: new optimized op-layer using serde_v8 (#9843)
- Improves op performance.
- Handle op-metadata (errors, promise IDs) explicitly in the op-layer vs
  per op-encoding (aka: out-of-payload).
- Remove shared queue & custom "asyncHandlers", all async values are
  returned in batches via js_recv_cb.
- The op-layer should be thought of as simple function calls with little
  indirection or translation besides the conceptually straightforward
  serde_v8 bijections.
- Preserve concepts of json/bin/min as semantic groups of their
  inputs/outputs instead of their op-encoding strategy, preserving these
  groups will also facilitate partial transitions over to v8 Fast API for the
  "min" and "bin" groups
2021-03-31 10:37:38 -04:00
Ryan Dahl f46e39c5c5
remove macro_use (#9884) 2021-03-26 12:34:25 -04:00
Yusuke Tanaka 385b14463c
refactor(lsp): remove unused code (#9897) 2021-03-26 15:46:55 +11:00
Yusuke Tanaka e7954413e1
upgrade: Rust 1.51.0 (#9895) 2021-03-25 19:17:37 +01:00
Kitson Kelly 5ebb401703
feat(lsp): add import completions (#9821) 2021-03-25 11:13:37 +11:00
Jean Pierre 77cfadf532
feat(lsp): implement textDocument/selectionRange (#9845)
Ref: #8643
2021-03-24 10:33:25 +11:00
Bert Belder fb5a2786ec
refactor(lsp): slightly reorganize diagnostics debounce logic (#9796)
This patch doesn't actually fix the bug I was hoping to fix, which is
that `update_diagnostics()` sometimes gets called even when there are
more updates that should be processed first. I did eventually figure out
that this issue is caused by Tokio's cooperative yielding, which
currently can't be disabled.

However overall it makes the debounce code somewhat more readable IMO,
which is why I'm suggesting to land it anyway.
2021-03-18 21:26:41 +01:00
Kitson Kelly 506b321d47
refactor(lsp): refactor completions and add tests (#9789) 2021-03-16 09:01:41 +11:00
Ryan Dahl 2ff9b01551
Revert "fix(cli/module_graph): Set useDefineForClassFields to true" (#9792)
Backwards incompatible change cannot be made in-between patch releases.

This commit broke std tests https://github.com/denoland/deno_std/runs/2112369372

This reverts commit c4709834b3.
2021-03-15 13:56:31 -04:00
Nayeem Rahman c4709834b3
fix(cli/module_graph): Set useDefineForClassFields to true (#9774)
Fixes #9773
2021-03-15 09:19:27 +11:00
Kitson Kelly 88a7fa36aa
fix(lsp): allow on disk files to change (#9746)
Fixes #9348
2021-03-10 21:39:16 +11:00
Kitson Kelly a020ebde2d
fix(lsp): diagnostics use own thread and debounce (#9572) 2021-03-10 13:41:35 +11:00
hvithrafn 79e2e6a1f4
chore(lsp): update lspower to 0.8.4 (#9663)
Co-authored-by: hvithrafn <hvithrafn@users.noreply.github.com>
2021-03-03 15:32:10 +11:00
Kitson Kelly dbdbe7a1cf
fix(lsp): improve exception handling on tsc snapshots (#9628)
Refs #9348
2021-03-01 11:53:20 +11:00
Kitson Kelly 097e9c44f4
feat(runtime): stabilise permissions and add event target capabilities (#9573) 2021-02-25 14:33:09 +11:00
Kitson Kelly 90e4c5dcde
reafactor(lsp): use generics with JSON values (#9587) 2021-02-25 14:15:55 +11:00
Kitson Kelly 2225e83da2
fix(lsp): handle data URLs properly (#9522)
Fixes #9514

Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
2021-02-18 15:37:05 +11:00
Kitson Kelly 78e34d4912
fix(lsp): document spans use original range (#9525)
Fixes: #9444

Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
2021-02-18 14:15:13 +11:00
Ryan Dahl c7dabc99ee
Make ModuleSpecifier a type alias, not wrapper struct (#9531) 2021-02-17 13:47:18 -05:00
Bartek Iwańczuk f6d6b24506
feat: support loading import map from URL (#9519)
This commit adds support for loading import maps from URLs,
both remote and local.

This feature is supported in CLI flag as well as in runtime
compiler API.
2021-02-17 14:32:57 +01:00
Yuki Tanaka ccd6ee5c23
feat(lsp): Implement textDocument/signatureHelp (#9330)
Co-authored-by: Kitson Kelly <me@kitsonkelly.com>
2021-02-16 13:34:09 +11:00
Kitson Kelly 64a1da84fe
fix(lsp): handle cached type dependencies properly (#9500) 2021-02-15 20:32:06 +11:00
Kitson Kelly 79916226b7
fix(lsp): properly handle static assets (#9476) 2021-02-12 22:49:42 +11:00
Kitson Kelly 54e53cc9ea
chore: Update to Rust 1.50.0 (#9479) 2021-02-12 21:08:36 +11:00
Kitson Kelly d6c05b09dd
feat(lsp): add deno cache code actions (#9471) 2021-02-12 15:17:48 +11:00
Kitson Kelly 6752be05cd
fix(lsp): handle type deps properly (#9436)
Fixes #9425
2021-02-10 09:46:12 +11:00
Kitson Kelly d95666cae0
fix(lsp): handle code lenses for non-documents (#9454) 2021-02-09 20:48:53 +11:00
Kitson Kelly 1f9e9002d5
fix(lsp): prepare diagnostics when the config changes (#9438) 2021-02-08 21:45:46 +11:00
Kitson Kelly e368c5d0f9
feat(lsp): add implementations code lens (#9441) 2021-02-08 21:45:10 +11:00
Kitson Kelly 09b79463d7 feat(lsp): add asset cache regression test
When we migrated away from all the locks, there was a regression that
was not caught immediately. The tsc::get_asset() would attempt to modify
the snapshot, but the problem was that the snapshot was a .clone() of
the inner language server's assets, which meant that modifications to
that where lost. When we then attempted to do a hover on those assets,
the inner language servers assets didn't have the retrieved asset, and
therefore would throw an error.
2021-02-08 10:47:32 +01:00
Ben Noordhuis ccbaedb138 fix(lsp): DRY asset cache lookup logic 2021-02-08 10:47:32 +01:00
Ben Noordhuis e7a7bf8a79 fix(lsp): fix asset cache lookup regression
Commit 2828690fc ("fix(lsp): fix deadlocks, use one big mutex") from
last month introduced a regression in asset cache lookups where results
of lazy caching were lost due to operating on a copy of the asset cache.

This commit fixes that by copying the asset from the copy to the real
cache.
2021-02-08 10:47:32 +01:00
Ben Noordhuis be10db10fd fix(lsp): remove Sources mutex
The mutex was used to hide the fact that the Sources object mutates
itself when it's queried. Be honest about that and mark everything that
directly or indirectly mutates it as `mut`.

This is a follow-up to commit 2828690fc7
from last month ("fix(lsp): fix deadlocks, use one big mutex (#9271)")
2021-02-08 10:47:32 +01:00
Kitson Kelly b6353672f8
fix(lsp): support codeAction/resolve (#9405) 2021-02-06 07:10:53 +11:00
Kitson Kelly 5b9376908a
fix(cli/lsp): fix using jsx/tsx when not emitting via tsc (#9407)
Closes #9308
Closes #9023
Closes #8993
2021-02-05 22:01:48 +11:00
Kitson Kelly b77fcbc518
feat(lsp): add TS quick fix code actions (#9396) 2021-02-05 05:53:02 +11:00
Kitson Kelly 534531e4dd
feat(lsp): add references code lens (#9316) 2021-02-01 14:30:41 +11:00
hvithrafn 013b8fe606
Update lspower dependency (#9179) 2021-01-29 14:34:33 -05:00
Kitson Kelly e7323002d9
feat(lsp): add performance measurements (#9209) 2021-01-27 11:32:49 +11:00
Kitson Kelly ada43cc56a
fix(lsp): handle mbc properly when formatting (#9273) 2021-01-27 07:50:13 +11:00
Luca Casonato 40fc5f55ea
chore: update crates (#9251)
Updates SWC, dprint, deno_lint, deno_doc, serde, and Tokio (to 1.1.0).

Co-authored-by: Kitson Kelly <me@kitsonkelly.com>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2021-01-26 17:00:40 +01:00
Kitson Kelly 8b6893438a
fix(lsp): complete list of unused diagnostics (#9274) 2021-01-26 21:55:59 +11:00
Ben Noordhuis 2828690fc7
fix(lsp): fix deadlocks, use one big mutex (#9271)
The LSP code had numerous places where competing threads could take out
out locks in different orders, making it very prone to deadlocks.
This commit sidesteps the entire issue by switching to a single lock.

The above is a little white lie: the Sources struct still uses a mutex
internally to avoid having to boil the ocean (because being honest about
what it does involves changing all its methods to `&mut self` but that
ripples out extensively...) I'll save that one for another day.
2021-01-26 10:55:04 +01:00
Kitson Kelly 2b4e0be43c
fix(lsp): reduce deadlocks with in memory documents (#9259) 2021-01-26 10:47:12 +11:00
Kitson Kelly 1a9209d1e3
fix(lsp): handle mbc documents properly (#9151)
Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
2021-01-22 21:03:16 +11:00
Hirochika Matsumoto 4b2df87c54
refactor(lsp): don't duplicate fields present in DocumentSpan (#9131) 2021-01-16 13:00:42 +01:00
Hirochika Matsumoto 8d5af6ca52
feat(lsp): Add textDocument/implementation (#9071)
Ref #8643
2021-01-13 08:53:27 +11:00
Bartek Iwańczuk 275a5c65a2
upgrade: tokio 1.0 (#8779)
Co-authored-by: Bert Belder <bertbelder@gmail.com>
2021-01-11 23:50:02 -08:00
Yusuke Tanaka d8fd71afdf
chore: update copyright to 2021 (#9092) 2021-01-11 18:13:41 +01:00
Luca Casonato a44349dfdf
feat: denort binary (#9041)
This commit adds new binary target called "denort".

It is a "lite" version of "deno" binary that can only execute
code embedded inside the binary itself.

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2021-01-08 03:08:51 +01:00
Bartek Iwańczuk bb88418221
refactor(cli): remove 'js' module, simplify compiler snapshot (#9020)
This commit removes "js" module from "cli".

It contained stuff related to TypeScript compiler (snapshot,
declaration files) and thus it was moved to "tsc" module.
2021-01-06 02:38:23 +01:00
Valentin Anger 444eca80a9
fix(lsp): Respect client capabilities for config and dynamic registration (#8865) 2021-01-05 08:52:20 +11:00
Kitson Kelly 587155f86d
feat(lsp): support specifying a tsconfig file (#8926) 2020-12-31 14:33:44 +11:00
Kitson Kelly 8011eced14
feat(lsp): add cache command (#8911) 2020-12-30 15:17:17 +11:00
Kitson Kelly e8a81724bb
fix(lsp): handle ts debug errors better (#8914)
Fixes #8864
2020-12-30 12:46:58 +11:00
hrsh7th 57b0562957
feat(lsp): Implement textDocument/rename (#8910) 2020-12-30 11:58:20 +11:00
Kitson Kelly a4d557126e
fix(lsp): provide diagnostics for unresolved modules (#8872) 2020-12-24 21:53:03 +11:00
Kitson Kelly 097c3379ba
feat(lsp): support the unstable setting (#8851) 2020-12-22 21:21:18 +11:00
Kitson Kelly b091c6c8c9
fix(lsp): respect enable flag for requests (#8850) 2020-12-22 16:42:32 +11:00
Luca Casonato bd85d0ed42
refactor: rewrite lsp to be async (#8727)
Co-authored-by: Luca Casonato <lucacasonato@yahoo.com>
2020-12-21 08:44:26 -05:00
Kitson Kelly 892d6cc997
refactor(lsp): optimise static assets (#8771)
Fixes #8158
2020-12-16 06:34:39 +11:00
Kitson Kelly 1a72c9ba23
fix(lsp): only resolve sources with supported schemas (#8696)
Fixes #8695
2020-12-10 11:12:46 +11:00
Kitson Kelly 95a6698cac
feat(lsp): support import maps (#8683) 2020-12-10 06:50:47 +11:00
Bartek Iwańczuk 9bff85836c
fix: pull .d.ts files from js mod (#8671) 2020-12-08 16:33:50 +01:00
Luca Casonato e94a18240e
feat(lsp): basic support for textDocument/completion (#8651) 2020-12-08 11:36:13 +01:00
Kitson Kelly 301d3e4b68
feat: add mvp language server (#8515)
Resolves #8400
2020-12-07 21:46:39 +11:00