From 4460336fdae3a6c0c8ebe8e6b8842604743cf985 Mon Sep 17 00:00:00 2001 From: Nayeem Rahman Date: Sun, 10 Sep 2023 20:09:45 +0100 Subject: fix(lsp): always enable semantic tokens responses (#20440) --- cli/tests/integration/lsp_tests.rs | 39 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'cli/tests/integration/lsp_tests.rs') diff --git a/cli/tests/integration/lsp_tests.rs b/cli/tests/integration/lsp_tests.rs index 263e66da5..64c59ce7d 100644 --- a/cli/tests/integration/lsp_tests.rs +++ b/cli/tests/integration/lsp_tests.rs @@ -5499,6 +5499,45 @@ fn lsp_npm_completions_auto_import_and_quick_fix_no_import_map() { ); } +#[test] +fn lsp_semantic_tokens_for_disabled_module() { + let context = TestContextBuilder::new() + .use_http_server() + .use_temp_cwd() + .build(); + let mut client = context.new_lsp_command().build(); + client.initialize_with_config( + |builder| { + builder.set_deno_enable(false); + }, + json!({ + "enable": false + }), + ); + client.did_open(json!({ + "textDocument": { + "uri": "file:///a/file.ts", + "languageId": "typescript", + "version": 1, + "text": "const someConst = 1; someConst" + } + })); + let res = client.write_request( + "textDocument/semanticTokens/full", + json!({ + "textDocument": { + "uri": "file:///a/file.ts" + } + }), + ); + assert_eq!( + res, + json!({ + "data": [0, 6, 9, 7, 9, 0, 15, 9, 7, 8], + }) + ); +} + #[test] fn lsp_completions_auto_import_and_quick_fix_with_import_map() { let context = TestContextBuilder::new() -- cgit v1.2.3