Skip to content

Commit

Permalink
fix snippet suggestion does not replace the input string
Browse files Browse the repository at this point in the history
  • Loading branch information
yeweiasia committed Aug 13, 2019
1 parent 63e865f commit 784a7fa
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ export class MonacoSnippetSuggestProvider implements monaco.modes.ISuggestSuppor
}

resolveCompletionItem(_: monaco.editor.ITextModel, __: monaco.Position, item: monaco.modes.ISuggestion): monaco.modes.ISuggestion {
const word = _.getWordAtPosition(__);
item.overwriteBefore = word.endColumn - word.startColumn;
return item instanceof MonacoSnippetSuggestion ? item.resolve() : item;
}

Expand Down

0 comments on commit 784a7fa

Please sign in to comment.