diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2024-01-14 18:29:17 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-14 18:29:17 +0100 |
commit | 0d51c1f90ecc3d276e17564c2471604b6dc1f2bd (patch) | |
tree | 60664f2442272fbd3feb2605ce604e2e97390613 /cli/tests/integration/lsp_tests.rs | |
parent | f3bb0a1a0e5ee3335d3c45db2be285791c7516cf (diff) |
feat: remove conditional unstable type-checking (#21825)
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.
Diffstat (limited to 'cli/tests/integration/lsp_tests.rs')
-rw-r--r-- | cli/tests/integration/lsp_tests.rs | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/cli/tests/integration/lsp_tests.rs b/cli/tests/integration/lsp_tests.rs index c287df5cd..94982c0a7 100644 --- a/cli/tests/integration/lsp_tests.rs +++ b/cli/tests/integration/lsp_tests.rs @@ -1904,7 +1904,7 @@ fn lsp_exclude_config() { } #[test] -fn lsp_hover_unstable_disabled() { +fn lsp_hover_unstable_always_enabled() { let context = TestContextBuilder::new().use_temp_cwd().build(); let mut client = context.new_lsp_command().build(); client.initialize_default(); @@ -1930,16 +1930,17 @@ fn lsp_hover_unstable_disabled() { assert_eq!( res, json!({ - "contents": [ + "contents":[ { - "language": "typescript", - "value": "type Deno.ForeignLibraryInterface = /*unresolved*/ any", + "language":"typescript", + "value":"interface Deno.ForeignLibraryInterface" }, - "", + "**UNSTABLE**: New API, yet to be vetted.\n\nA foreign library interface descriptor.", + "\n\n*@category* - FFI", ], - "range": { - "start": { "line": 0, "character": 14 }, - "end": { "line": 0, "character": 37 } + "range":{ + "start":{ "line":0, "character":14 }, + "end":{ "line":0, "character":37 } } }) ); @@ -1951,6 +1952,7 @@ fn lsp_hover_unstable_enabled() { let context = TestContextBuilder::new().use_temp_cwd().build(); let mut client = context.new_lsp_command().build(); client.initialize(|builder| { + // NOTE(bartlomieju): this is effectively not used anymore. builder.set_unstable(true); }); client.did_open(json!({ |