Trigger suggestions for property completions

Adds logic to trigger the suggestion widget when completing a property if it expects a block or has value suggestions, improving the user experience in the config editor.
This commit is contained in:
Sergey Krashevich
2025-12-27 10:26:15 +03:00
parent 76bdc7e065
commit 0fd2217bd2
+2
View File
@@ -915,12 +915,14 @@
const innerIndent = indent + ' ';
const insertText = wantsBlock ? `${key}:\n${innerIndent}` : `${key}: `;
const hasValueSuggestions = !wantsBlock && getValueSuggestions(s).length > 0;
return {
label: key,
kind: monaco.languages.CompletionItemKind.Property,
insertText,
insertTextRules: monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet,
command: (wantsBlock || hasValueSuggestions) ? {id: 'editor.action.triggerSuggest'} : undefined,
documentation: s && s.description,
range,
};