Merge pull request #180403 from microsoft/hediet/b/ideological-wasp

Removes unneeded additionalReservedLineCount from GhostText
This commit is contained in:
Henning Dieterichs 2023-04-20 16:00:02 +02:00 committed by GitHub
commit 3f6a54de51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 3 additions and 4 deletions

View File

@ -10,7 +10,6 @@ export class GhostText {
constructor(
public readonly lineNumber: number,
public readonly parts: GhostTextPart[],
public readonly additionalReservedLineCount: number = 0
) {
}

View File

@ -119,7 +119,7 @@ export class GhostTextWidget extends Disposable {
additionalLines,
hiddenRange,
lineNumber: ghostText.lineNumber,
additionalReservedLineCount: ghostText.additionalReservedLineCount,
additionalReservedLineCount: this.model.minReservedLineCount.read(reader),
targetTextModel: textModel,
};
});

View File

@ -187,7 +187,7 @@ export class InlineCompletionsModel extends Disposable {
const newGhostText = edit.computeGhostText(model, mode, cursor, editPreviewLength);
// Show an invisible ghost text to reserve space
return newGhostText ?? new GhostText(edit.range.endLineNumber, [], 0);
return newGhostText ?? new GhostText(edit.range.endLineNumber, []);
} else {
if (!this._isActive.read(reader)) { return undefined; }
const item = this.selectedInlineCompletion.read(reader);

View File

@ -140,7 +140,7 @@ export class SingleTextEdit {
}
}
return new GhostText(lineNumber, parts, 0);
return new GhostText(lineNumber, parts);
}
}