提交 b2dee574 编写于 作者: I isidor

fixes #90974

上级 b34a0d0a
......@@ -149,10 +149,12 @@ export class Repl extends ViewPane implements IHistoryNavigationWidget {
if (item && item.label) {
let insertTextRules: CompletionItemInsertTextRule | undefined = undefined;
let insertText = item.text || item.label;
if (typeof item.selectionStart === 'number' && typeof item.selectionLength === 'number') {
if (typeof item.selectionStart === 'number') {
// If a debug completion item sets a selection we need to use snippets to make sure the selection is selected #90974
insertTextRules = CompletionItemInsertTextRule.InsertAsSnippet;
insertText = insertText.substr(0, item.selectionStart) + '${1:' + insertText.substr(item.selectionStart, item.selectionLength) + '}$0' + insertText.substr(item.selectionStart + item.selectionLength);
const selectionLength = typeof item.selectionLength === 'number' ? item.selectionLength : 0;
const placeholder = selectionLength > 0 ? '${1:' + insertText.substr(item.selectionStart, selectionLength) + '}$0' : '$0';
insertText = insertText.substr(0, item.selectionStart) + placeholder + insertText.substr(item.selectionStart + selectionLength);
}
suggestions.push({
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册