Skip to content

Commit

Permalink
fix: completion replace range incorrect in import statement
Browse files Browse the repository at this point in the history
close #1227
  • Loading branch information
johnsoncodehk committed Apr 29, 2022
1 parent f4338ab commit 310ceb0
Showing 1 changed file with 4 additions and 1 deletion.
Expand Up @@ -47,7 +47,10 @@ export function register(
document.positionAt(completionContext.optionalReplacementSpan.start + completionContext.optionalReplacementSpan.length),
) : undefined;

let line = document.getText({ start: position, end: { line: position.line + 1, character: 0 } });
let line = document.getText({
start: { line: position.line, character: 0 },
end: { line: position.line + 1, character: 0 },
});
if (line.endsWith('\n')) {
line = line.substring(0, line.length - 1);
}
Expand Down

0 comments on commit 310ceb0

Please sign in to comment.