Skip to content

Commit be840fc

Browse files
committed
Trigger completion automatically after completing argument names
Fixes #3682.
1 parent 6db9cea commit be840fc

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎src/extension/analysis/analyzer_lsp.ts‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,13 @@ export class LspAnalyzer extends Analyzer {
7575
/// for convenience, eg. when completing the "import '';" snippet people expect completion
7676
/// to immediately reopen.
7777
function shouldTriggerCompletionAgain(item: CompletionItem): boolean {
78-
if (item.label === "import '';")
78+
const label = typeof item.label === "string" ? item.label : item.label.label;
79+
80+
if (label === "import '';")
81+
return true;
82+
83+
// When completing on named args, re-trigger for the value.
84+
if (label.trimRight().endsWith(":"))
7985
return true;
8086

8187
if (item.kind === CompletionItemKind.Folder) {

0 commit comments

Comments
 (0)