1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-01 09:24:20 -04:00
Commit graph

271 commits

Author SHA1 Message Date
David Sherret
eda6e58520
refactor: upgrade to import_map v0.6 (#13368) 2022-01-13 18:17:56 -05:00
David Sherret
f12164646b
refactor: move transpiling to deno_ast (#13332) 2022-01-13 11:58:00 -05:00
Ryan Dahl
1fb5858009
chore: update copyright to 2022 (#13306)
Co-authored-by: Erfan Safari <erfanshield@outlook.com>
2022-01-07 22:09:52 -05:00
Kitson Kelly
57bfa87b2c
feat(lsp): provide registry details on hover if present (#13294)
Closes: #13272
2022-01-07 11:27:13 +11:00
David Sherret
19c8cd3a45
fix: upgrade swc_ecmascript to 0.103 (#13284) 2022-01-04 17:02:56 -05:00
Kitson Kelly
01ff7a8784
fix(lsp): handle repeating patterns in registry correctly (#13275) 2022-01-04 17:42:33 +11:00
Kitson Kelly
2e72893fa2
fix(lsp): better handling of folders in registry completions (#13250) 2022-01-02 16:27:19 +11:00
Kitson Kelly
0ae46a975c
fix(lsp): properly generate data URLs for completion items (#13246) 2022-01-02 16:25:42 +11:00
Aaron O'Mullan
42777f2541
cleanup(cli/lsp): use op Extensions (#13225) 2021-12-29 15:22:00 +01:00
Kitson Kelly
6d017d42aa
fix(lsp): add code lens for tests just using named functions (#13218)
Fixes: #13216
2021-12-29 14:00:24 +11:00
Kitson Kelly
8547a37132
chore: update deno_graph and deno_doc (#13173) 2021-12-22 14:25:06 +01:00
Kitson Kelly
b5fdfb9d25
feat(lsp): supply accept header when fetching registry config (#13159)
Closes #13153
2021-12-21 13:40:22 +11:00
Jesper van den Ende
0888ba7a8d
feat(lsp): add code lens for debugging tests (#13138)
Closes: #13130
2021-12-20 16:00:38 +11:00
Divy Srivastava
6de53b631f
refactor: use once_cell instead of lazy_static (#13135) 2021-12-18 16:14:42 -05:00
Nayeem Rahman
9ffc7edc23
refactor(cli): use GraphData for check and emit (#12960) 2021-12-16 21:45:41 +11:00
Kitson Kelly
e28fb70aee
fix(lsp): provide diagnostics for import assertions (#13105)
Fixes: #13099
2021-12-16 14:53:17 +11:00
David Sherret
6c324acf23
feat: REPL import specifier auto-completions (#13078) 2021-12-15 13:23:43 -05:00
Bartek Iwańczuk
a1f0796fcc
feat: Add support for import assertions and JSON modules (#12866)
This commit adds proper support for import assertions and JSON modules.

Implementation of "core/modules.rs" was changed to account for multiple possible
module types, instead of always assuming that the code is an "ES module". In
effect "ModuleMap" now has knowledge about each modules' type (stored via
"ModuleType" enum). Module loading pipeline now stores information about
expected module type for each request and validates that expected type matches
discovered module type based on file's "MediaType".

Relevant tests were added to "core/modules.rs" and integration tests,
additionally multiple WPT tests were enabled.

There are still some rough edges in the implementation and not all WPT were
enabled, due to:
a) unclear BOM handling in source code by "FileFetcher"
b) design limitation of Deno's "FileFetcher" that doesn't download the same
module multiple times in a single run

Co-authored-by: Kitson Kelly <me@kitsonkelly.com>
2021-12-15 19:22:36 +01:00
Kitson Kelly
e8d7b430ce
chore: updates to support deno_graph API changes (#13080) 2021-12-15 07:39:20 +11:00
David Sherret
c9d32e0581
fix(lsp): handle import specifier not having a trailing quote (#13074)
* fix(lsp): handle import specifier not having a trailing quote

* clean up

* Add test.
2021-12-13 16:28:35 -05:00
Kitson Kelly
a54fc7a129
feat(lsp): improve registry completion suggestions (#13023)
Resolves #10051
2021-12-14 06:24:11 +11:00
Kitson Kelly
345f0fbe5c
feat(cli): update to TypeScript 4.5 (#12410)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2021-12-10 09:12:21 +11:00
Kitson Kelly
2347e60934
feat(lsp): registry suggestion cache respects cache headers (#13010)
Fixes #9931
2021-12-09 22:16:17 +11:00
David Sherret
1507b8c984
fix: upgrade swc fixing many bundling and --no-check bugs (#13025) 2021-12-08 19:12:14 -05:00
Bartek Iwańczuk
c59f90d01f
chore: upgrade to Rust 1.57.0 (#12968) 2021-12-04 14:19:06 +01:00
Bartek Iwańczuk
e68a241946
chore: upgrade lspower to 1.4.0 (#12894) 2021-11-25 12:10:12 +11:00
David Sherret
adc5974333
fix(lsp): lsp should respect include/exclude files in format config (#12876) 2021-11-24 15:14:19 -05:00
David Sherret
0f90b4665a
chore(lsp): fix possible race condition with tests expecting 3 publishDiagnostics messages (#12868)
The tests expect 3 publish notifications. It was possible for less than 3 to occur if two or more tasks set the diagnostics in the collection, exited the lock at the same time, then called `publish_diagnostics`
2021-11-23 20:04:27 -05:00
igorsaux
3f8c3b8568
fix(lsp): normalize urls in did_change_watched_files (#12873) 2021-11-23 12:32:40 -05:00
David Sherret
51e3db956a
fix(cli): config file should resolve paths relative to the config file (#12867)
* Add `specifier_to_file_path` to support converting a ModuleSpecifier with a unix-style path to a PathBuf on Windows.
2021-11-23 10:38:11 -05:00
Kitson Kelly
210300d049
feat(lsp): add type definition provider (#12789) 2021-11-23 11:09:19 +11:00
Kitson Kelly
bf5657cd59
feat(lsp): add workspace symbol provider (#12787) 2021-11-23 11:08:56 +11:00
igorsaux
3abe31252e
fix(lsp): use lint exclude files list from the config file (#12825) 2021-11-22 18:10:33 -05:00
David Sherret
c82ce74133
refactor(lsp): remove Documents mutex and require Documents to be mutated to change it (#12747) 2021-11-18 13:50:24 -05:00
Kitson Kelly
14f83da221
fix(lsp): tag deprecated diagnostics properly (#12801) 2021-11-18 13:05:20 +11:00
Kitson Kelly
cc38580106
fix(lsp): retain module dependencies when parse is invalid (#12782)
Fixes #12753
2021-11-17 09:23:25 +11:00
Ryan Dahl
b2036a4db7
refactor: re-export anyhow from deno_core (#12777) 2021-11-16 09:02:28 -05:00
David Sherret
28dbb4a95e
refactor(lsp): prefer using document instead of documents collection (#12720) 2021-11-12 11:42:04 -05:00
Kitson Kelly
31fde9deba
chore(lsp): align ScriptElementKind to current versions of TypeScript/vscode (#12663) 2021-11-09 21:45:40 +11:00
Kitson Kelly
f5eb177f50
feat(cli): support React 17 JSX transforms (#12631)
Closes #8440
2021-11-09 12:26:39 +11:00
Bert Belder
f1b1a3f389
refactor: move mod tokio_util to runtime (#12332)
This avoids a bunch of duplicated code.
2021-11-08 12:49:11 -08:00
Kitson Kelly
182de1452b
fix(lsp): display module types only dependencies on hover (#12683)
Fixes: #12675
2021-11-08 11:50:48 +11:00
Kitson Kelly
91f8bdda2c
fix(lsp): cache unsupported import completion origins (#12661)
Fixes #12621
2021-11-08 09:35:32 +11:00
Luca Casonato
b6b25671b2
fix(lsp): display signature docs as markdown (#12636)
These were previously displayed as plain text. Now they are displayed as
`MarkupContent` with type `Markdown`.
2021-11-07 23:26:11 +01:00
Zheyu Zhang
efe956b4fd
fix(lint): use recommended tag if there is no tags in config file or flags (#12644) 2021-11-04 11:12:12 -04:00
Luca Casonato
318dcc33af
Revert "feat(cli): enable useUnknownInCatchVariables by default" (#12643)
This partially reverts commit a065604155.

Co-authored-by: Kitson Kelly <me@kitsonkelly.com>
2021-11-04 11:30:37 +01:00
David Sherret
0ec151b8cb
chore: upgrade deno_ast to 0.5.0 (#12595) 2021-11-01 16:22:27 -04:00
Kitson Kelly
34a9ddff09
refactor(lsp): use deno_graph and single document struct (#12535)
Closes #12473
2021-10-29 10:56:01 +11:00
Kitson Kelly
a065604155
feat(cli): enable useUnknownInCatchVariables by default (#12547)
Closes #11826

**BREAKING CHANGE** this behaviour was disable when introduced in Deno 1.14/TypeScript 4.4. It will highlight code that unsafely handles variables that are caught, and will cause type errors in unsafe code.
2021-10-28 08:43:40 +11:00
David Sherret
43cd0459b9
fix(lsp): formatting should error on certain additional swc diagnostics (#12491) 2021-10-21 10:18:18 -04:00
David Sherret
9b1f0c8ba3
chore: upgrade crates based on deno ast 0.3 (#12403) 2021-10-12 09:58:04 -04:00
Bartek Iwańczuk
f332d72f16
fix(lsp): lint diagnostics respect config file (#12338)
This commit fixes problem with LSP where diagnostics coming
from "deno lint" don't respect configuration file.

LSP was changed to store "Option<ConfigFile>", "Option<LintConfig>"
and "Option<FmtConfig>" on "Inner"; as well as storing "Option<LintConfig>"
and "Option<FmtConfig>" on "StateSnapshot".

Co-authored-by: Kitson Kelly <me@kitsonkelly.com>
2021-10-12 00:02:33 +02:00
Kitson Kelly
a7baf5f2bb
refactor: integrate deno_graph into CLI (#12369) 2021-10-11 08:26:22 +11:00
Ryan Dahl
01da1d0adc
refactor: Rename ProgramState to ProcState (#12204)
Move Arc into struct
2021-09-24 11:10:42 -04:00
Kitson Kelly
ccb3387946
fix(lsp): align filter text to vscode logic (#12081)
Fixes #11861
2021-09-16 12:07:52 +10:00
Kitson Kelly
d36b01ff69
fix(lsp): correctly parse registry patterns (#12063) 2021-09-14 14:40:35 +02:00
Satya Rohith
bb7ee4f445
feat(lsp): ignore specific lint for entire file (#12023) 2021-09-14 17:46:51 +05:30
Bartek Iwańczuk
0dbeb774ba
feat(fmt): add support for configuration file (#11944)
This commit adds support for configuration file for "deno fmt"
subcommand. It is also respected by LSP when formatting
files.

Example configuration:
{
    "fmt": {
        "files": {
            "include": ["src/"],
            "exclude": ["src/testdata/"]
        },
        "options": {
            "useTabs": true,
            "lineWidth": 80,
            "indentWidth": 4,
            "singleQuote": true,
            "textWrap": "preserve"
        }
    }
}
2021-09-13 20:19:10 +02:00
Satya Rohith
84f8747157
fix(lsp): support data urls in deno.importMap option (#11397) 2021-09-13 09:49:23 +05:30
Kitson Kelly
a442821d97
chore: update deno_* crates (#12020) 2021-09-13 10:06:36 +10:00
David Sherret
00d62e64bf
chore(lsp): temporarily reparse AST for linting (#11988) 2021-09-12 09:42:11 -04:00
Bartek Iwańczuk
d236f432b8
refactor: use import_map crate (#11974)
Removes ImportMap implementation from "cli/" and instead
uses "import_map" crate
2021-09-11 03:38:24 +02:00
David Sherret
2c2e3ec1ca
refactor(lsp): use deno_ast and cache swc ASTs (#11780) 2021-09-07 10:39:32 -04:00
Feng Yu
bb99d5da4c
fix(doc): fix rustdoc bare_urls warning (#11921) 2021-09-05 16:22:45 +02:00
Bartek Iwańczuk
d93570a619
feat(lint): add support for config file and CLI flags for rules (#11776)
This commit adds support for following flags in deno lint subcommand:

--config - allows to load configuration file and parses "lint" object
--rules-tags=<tags> - allows specifying which set of tagged rules should be run
--rules-include=<rules> - allow specifying which rules should be run
--rules-exclude=<rules> - allow specifying which rules should not be run
2021-09-03 17:01:58 +02:00
Bartek Iwańczuk
c84532b6d5
chore: upgrade crates (#11894)
Co-authored-by: David Sherret <dsherret@gmail.com>
2021-09-02 17:38:19 +02:00
Kitson Kelly
935133f53a
feat(cli): Update to TypeScript 4.4 (#11678) 2021-08-27 10:12:59 +10:00
Kitson Kelly
0d83afd939
fix(lsp): better handling of languageId (#11755)
Fixes #11521
Fixes #11742
2021-08-19 13:19:12 +10:00
Pankaj Patil
e55454613c
docs(lsp): change deno/registryStatus -> deno/registryState (#11760) 2021-08-18 12:17:52 -04:00
David Sherret
15a763152f
chore: move test files to testdata directory (#11601) 2021-08-11 10:20:47 -04:00
Kitson Kelly
f7e416bc7f
feat(lsp): support clients which do not support disabled code actions (#11612)
Closes: #11610
2021-08-10 09:56:34 +10:00
TheAifam5
353a4a1af3
feat: Add --unsafely-treat-insecure-origin-as-secure flag to disable SSL verification (#11324)
This commit adds "--unsafely-treat-insecure-origin-as-secure" flag 
that allows to disable SSL verification for all domains, or specific
domains if they were passed as an argument to the flag.

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2021-08-09 16:53:21 +02:00
David Sherret
466d3df9d1
refactor: make ParsedModule implement Sync (#11581) 2021-08-06 10:36:16 -04:00
Jean Pierre
728d205d9d
feat(lsp): implement refactoring code actions (#11555)
Closes: denoland/vscode_deno#433
2021-08-06 11:46:32 +10:00
David Sherret
a13db3650e
fix(lsp): do not output to stderr before exiting the process (#11562) 2021-07-31 21:05:09 -04:00
Yusuke Tanaka
8f00b5542c
chore: upgrade Rust to 1.54.0 (#11554) 2021-07-30 15:03:41 +02:00
Kitson Kelly
667b026798
feat(lsp): ability to set DENO_DIR via settings (#11527)
Ref: denoland/vscode_deno#287
2021-07-28 07:25:09 +10:00
Kitson Kelly
c6f4e41529
refactor(lsp): minor improvements to handling closed documents (#11518)
Ref #10897
2021-07-27 07:40:12 +10:00
Kitson Kelly
72ac9c3ae0
fix(lsp): handle importmaps properly (#11496)
Fixes: #11146
Fixes: #11456
Fixes: #10439
2021-07-25 15:33:42 +10:00
Kitson Kelly
bdc53b45b7
fix(lsp): do not populate maybe_type slot with import type dep (#11477)
Fixes: #11458
Fixes: #11461
Closes: denoland/vscode_deno#414
2021-07-22 15:00:45 +10:00
Kitson Kelly
c34fef4b71
feat(lsp): add workspace config to status page (#11459) 2021-07-21 11:50:43 +10:00
David Sherret
79ac050d29
chore: upgrade to swc 0.46 (#11402) 2021-07-14 21:28:01 -04:00
Bartek Iwańczuk
27e1b4cb5a
feat(core): return v8::Value from JsRuntime::execute_script (#11129)
This commit changes return type of JsRuntime::execute_script to include
v8::Value returned from evaluation.

When embedding deno_core it is sometimes useful to be able to inspect
script evaluation value without the hoops of adding ops to store the
value on the OpState.

v8::Global<v8::Value> is used so consumers don't have to pass
scope themselves.
2021-07-08 18:56:53 +02:00
David Sherret
7fc0e8ec8c
chore: use parking_lot for synchronization primitives to align with tokio (#11289)
parking_lot is already transitively used in tokio via the "full" cargo feature
2021-07-06 23:48:01 -04:00
Jimmy Wärting
2c0b0e45b7
refactor: asynchronous blob backing store (#10969)
Co-authored-by: Luca Casonato <hello@lcas.dev>
2021-07-05 15:34:37 +02:00
David Sherret
1f4cdc067a
fix(lsp): reload import registries should not error when the module registries directory does not exist (#11123) 2021-06-25 21:44:27 -04:00
Kitson Kelly
9e51766f3e
feat(lsp): dependency hover information (#11090) 2021-06-25 09:06:51 +10:00
Kitson Kelly
8ed83cba7e
fix(lsp): handle invalid config setting better (#11104)
Fixes #11100 
Fixes #10808
2021-06-24 22:41:04 +10:00
David Sherret
477273085f
chore: use lsp to get parent process id (#11083)
Removes the previously added internal `--parent-pid` flag. This solution is better.
2021-06-22 21:48:01 -04:00
Bartek Iwańczuk
9105892ec8
refactor: unify JavaScript script execution method (#11043)
This commit renames "JsRuntime::execute" to "JsRuntime::execute_script". Additionally
same renames were applied to methods on "deno_runtime::Worker" and
"deno_runtime::WebWorker".

A new macro was added to "deno_core" called "located_script_name" which
returns the name of Rust file alongside line no and col no of that call site.
This macro is useful in combination with "JsRuntime::execute_script"
and allows to provide accurate place where "one-off" JavaScript scripts
are executed for internal runtime functions.

Co-authored-by: Nayeem Rahman <nayeemrmn99@gmail.com>
2021-06-22 01:45:41 +02:00
Kitson Kelly
281c4cd8fc
feat(cli): support "types" when type checking (#10999)
Fixes #10677
2021-06-22 07:18:32 +10:00
Satya Rohith
952caa79b3
feat(lsp): quick fix actions to ignore lint errors (#10627)
Closes #10122
2021-06-21 16:43:35 +10:00
David Sherret
60071c941b
fix(lsp): do not rename in strings and comments (#11041) 2021-06-19 11:23:50 -04:00
David Sherret
419fe2e6b4
chore: fix new linting errors flagged by Rust 1.53 (#11029) 2021-06-17 21:48:16 -04:00
David Sherret
aecf989d43
chore(lsp): add --parent-pid <pid> flag (#11023)
This commit adds a new `--parent-pid <pid>` flag to `deno lsp` that when provided starts a task that checks for the existence of the provided process id (ex. vscode's) every 30 seconds. If the process doesn't exist (meaning the deno process has nothing interacting with it), then it terminates itself.
2021-06-17 19:57:58 -04:00
Yusuke Tanaka
8031644e65
chore: upgrade Rust to 1.53.0 (#11021) 2021-06-17 15:56:30 -04:00
Ryan Dahl
9c42b5e03b
Remove various unnecessary allow(clippy) declarations (#10971) 2021-06-15 19:22:28 +02:00
Bartek Iwańczuk
6091ea098a
refactor: merge deno_file crate into deno_web (#10914)
This refactor makes it so there's one less crate to publish on each release.
2021-06-10 15:26:10 +02:00
Kitson Kelly
6b826033a4
feat(lsp): add additional logging information (#10890) 2021-06-09 10:00:26 +10:00
Kitson Kelly
3b3be024fa
feat(lsp): add test code lens (#10874)
Ref #8643
2021-06-07 21:38:07 +10:00