bug fix for lines add extra lines before inserting

This commit is contained in:
Falko Victor Habel 2024-10-09 14:24:53 +02:00
parent a56d47747d
commit 439a538c7e
1 changed files with 3 additions and 0 deletions

View File

@ -100,7 +100,9 @@ class CompletionManager {
} }
public async showPreview() { public async showPreview() {
this.completionText = '\n' + this.completionText;
const completionLines = this.completionText.split('\n'); const completionLines = this.completionText.split('\n');
const emptyLine = ''; // Empty line for spacing const emptyLine = ''; // Empty line for spacing
const previewLines = [emptyLine, ...completionLines, emptyLine]; const previewLines = [emptyLine, ...completionLines, emptyLine];
@ -166,6 +168,7 @@ async function autocompleteCommand(textEditor: vscode.TextEditor, edit: vscode.T
console.log('Completion generated:', completionText); console.log('Completion generated:', completionText);
const completionManager = new CompletionManager(textEditor, position, completionText); const completionManager = new CompletionManager(textEditor, position, completionText);
await completionManager.showPreview(); await completionManager.showPreview();
activeCompletionManager = completionManager; activeCompletionManager = completionManager;