mirror of
https://github.com/denoland/deno.git
synced 2024-12-25 00:29:09 -05:00
fix(lsp): always enable semantic tokens responses (#20440)
This commit is contained in:
parent
0b3968c468
commit
4460336fda
2 changed files with 41 additions and 6 deletions
|
@ -2832,9 +2832,7 @@ impl Inner {
|
||||||
let specifier = self
|
let specifier = self
|
||||||
.url_map
|
.url_map
|
||||||
.normalize_url(¶ms.text_document.uri, LspUrlKind::File);
|
.normalize_url(¶ms.text_document.uri, LspUrlKind::File);
|
||||||
if !self.is_diagnosable(&specifier)
|
if !self.is_diagnosable(&specifier) {
|
||||||
|| !self.config.specifier_enabled(&specifier)
|
|
||||||
{
|
|
||||||
return Ok(None);
|
return Ok(None);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2869,9 +2867,7 @@ impl Inner {
|
||||||
let specifier = self
|
let specifier = self
|
||||||
.url_map
|
.url_map
|
||||||
.normalize_url(¶ms.text_document.uri, LspUrlKind::File);
|
.normalize_url(¶ms.text_document.uri, LspUrlKind::File);
|
||||||
if !self.is_diagnosable(&specifier)
|
if !self.is_diagnosable(&specifier) {
|
||||||
|| !self.config.specifier_enabled(&specifier)
|
|
||||||
{
|
|
||||||
return Ok(None);
|
return Ok(None);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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]
|
#[test]
|
||||||
fn lsp_completions_auto_import_and_quick_fix_with_import_map() {
|
fn lsp_completions_auto_import_and_quick_fix_with_import_map() {
|
||||||
let context = TestContextBuilder::new()
|
let context = TestContextBuilder::new()
|
||||||
|
|
Loading…
Reference in a new issue