summaryrefslogtreecommitdiff
path: root/cli
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2022-12-30 14:11:50 +0100
committerGitHub <noreply@github.com>2022-12-30 14:11:50 +0100
commit98bbf87742969802b392130c536454aa61a20395 (patch)
tree09a66a1daeadc9ee2706e2225a82fae96776f64f /cli
parent218d7ab7780d5e44d3badd1102a65a1be2afd00a (diff)
fix(lsp): less agressive completion triggers (#17225)
Closes https://github.com/denoland/deno/issues/17056 Closes https://github.com/denoland/deno/issues/17055
Diffstat (limited to 'cli')
-rw-r--r--cli/lsp/tsc.rs4
-rw-r--r--cli/tests/lsp_tests.rs14
2 files changed, 5 insertions, 13 deletions
diff --git a/cli/lsp/tsc.rs b/cli/lsp/tsc.rs
index 7145d00c2..8a83839bf 100644
--- a/cli/lsp/tsc.rs
+++ b/cli/lsp/tsc.rs
@@ -2007,6 +2007,10 @@ impl CompletionEntryDetails {
documentation,
command,
additional_text_edits,
+ // NOTE(bartlomieju): it's not entirely clear to me why we need to do that,
+ // but when `completionItem/resolve` is called, we get a list of commit chars
+ // even though we might have returned an empty list in `completion` request.
+ commit_characters: None,
..original_item.clone()
})
}
diff --git a/cli/tests/lsp_tests.rs b/cli/tests/lsp_tests.rs
index 48f354248..1a03d8217 100644
--- a/cli/tests/lsp_tests.rs
+++ b/cli/tests/lsp_tests.rs
@@ -3958,12 +3958,6 @@ export class DuckConfig {
},
"newText": "import { foo } from \"./b.ts\";\n\n"
}
- ],
- "commitCharacters": [
- ".",
- ",",
- ";",
- "("
]
}))
);
@@ -4077,13 +4071,7 @@ export class DuckConfig {
"sortText": "11",
"filterText": "type=\"$1\"",
"insertText": "type=\"$1\"",
- "insertTextFormat": 2,
- "commitCharacters": [
- ".",
- ",",
- ";",
- "("
- ]
+ "insertTextFormat": 2
}))
);
}