Skip to content

Commit 0f46fe3

Browse files
committed
Merged PR 476348: FIX: Stars Committed to Editor in CSHTML Files
- added a special case for intellicode items so stars are not committed to editor Related work items: #1830006
1 parent 554be59 commit 0f46fe3

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/razor/src/Completion/RazorCompletionItemProvider.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,15 @@ export class RazorCompletionItemProvider
118118
completionItem.commitCharacters = completionItem.commitCharacters.filter(
119119
commitChar => commitChar !== '{' && commitChar !== '(' && commitChar !== '*');
120120
}
121+
122+
// for intellicode items, manually set the insertText to avoid including stars in the commit
123+
if (completionItem.label.toString().includes('\u2605')){
124+
// vscode.CompletionItem does not have textEditText, which was added in 3.17
125+
let intellicodeCompletion: CompletionItem = completionItem as CompletionItem;
126+
if (intellicodeCompletion.textEditText){
127+
completionItem.insertText = intellicodeCompletion.textEditText;
128+
}
129+
}
121130
}
122131

123132
const isIncomplete = completions instanceof Array ? false

0 commit comments

Comments
 (0)