Don't compute ghost text that is not supported. Thus, no space is reserved for unsupported ghost text.

This commit is contained in:
Henning Dieterichs committed 2021-05-30 23:01:36 +02:00
1 parent ea02f214c7
commit db1bd650dc
1 file changed
+7 -1
@@ -434,11 +434,17 @@ export function inlineCompletionToGhostText(inlineCompletion: NormalizedInlineCo
return undefined;
}
const position = inlineCompletion.range.getEndPosition();
const lines = strings.splitLines(inlineCompletion.text.substr(valueToBeReplaced.length));
if (lines.length > 1 && textModel.getLineMaxColumn(position.lineNumber) !== position.column) {
// Such ghost text is not supported.
return undefined;
}
return {
lines,
position: inlineCompletion.range.getEndPosition()
position
};
}