chore: delete comments
This commit is contained in:
parent
0191f986bc
commit
bd3288e751
3 changed files with 7 additions and 43 deletions
|
|
@ -366,7 +366,6 @@ export class NextEditProvider {
|
|||
|
||||
const promptMetadata = await renderPrompt(
|
||||
helper,
|
||||
// historyDiff ?? this.diffContext,
|
||||
ctx,
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -133,7 +133,6 @@ export class JumpManager {
|
|||
return false;
|
||||
}
|
||||
|
||||
// if (editor) {
|
||||
const visibleRanges = editor.visibleRanges;
|
||||
if (visibleRanges.length === 0) {
|
||||
console.log("No visible ranges in editor, cannot suggest jump");
|
||||
|
|
@ -141,7 +140,6 @@ export class JumpManager {
|
|||
return false;
|
||||
}
|
||||
|
||||
// if (visibleRanges.length > 0) {
|
||||
const visibleRange = visibleRanges[0];
|
||||
const topLineNumber = visibleRange.start.line;
|
||||
const bottomLineNumber = visibleRange.end.line;
|
||||
|
|
@ -175,9 +173,6 @@ export class JumpManager {
|
|||
new vscode.Range(decorationLine, 0, decorationLine, 0),
|
||||
vscode.TextEditorRevealType.InCenter,
|
||||
);
|
||||
// }
|
||||
|
||||
// }
|
||||
|
||||
// Set up a way to detect when the jump is complete.
|
||||
const disposable = vscode.window.onDidChangeTextEditorSelection(() => {
|
||||
|
|
@ -200,7 +195,7 @@ export class JumpManager {
|
|||
setTimeout(() => {
|
||||
this._jumpInProgress = false;
|
||||
disposable.dispose();
|
||||
}, 5000);
|
||||
}, 10000);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -423,46 +423,15 @@ export class ContinueCompletionProvider
|
|||
const currCursorPos = editor.selection.active;
|
||||
|
||||
if (this.isNextEditActive) {
|
||||
// if (!this.nextEditProvider.isStartOfChain()) {
|
||||
// const jumpPosition = new vscode.Position(
|
||||
// (outcome as NextEditOutcome).editableRegionStartLine,
|
||||
// 0,
|
||||
// );
|
||||
|
||||
// // Suggest a jump if there is a valid next location.
|
||||
// // This will set isJumpInProgress if a jump is suggested.
|
||||
// await this.jumpManager.suggestJump(
|
||||
// currCursorPos,
|
||||
// jumpPosition,
|
||||
// outcome.completion,
|
||||
// );
|
||||
|
||||
// // If a jump was just suggested, don't show ghost text yet.
|
||||
// if (this.jumpManager.isJumpInProgress()) {
|
||||
// // Store this completion to be rendered after jump is complete.
|
||||
// this.jumpManager.setCompletionAfterJump({
|
||||
// completionId: completionId,
|
||||
// outcome: outcome as NextEditOutcome,
|
||||
// currentPosition: jumpPosition,
|
||||
// });
|
||||
|
||||
// return undefined; // Don't show anything yet!
|
||||
// }
|
||||
|
||||
// return undefined;
|
||||
// }
|
||||
if (!this.nextEditProvider.isStartOfChain()) {
|
||||
// Try suggesting jumps for each location in the queue
|
||||
// Try suggesting jumps for each location in the queue.
|
||||
let jumpSuccessful = false;
|
||||
// let attempts = 0;
|
||||
|
||||
while (
|
||||
this.nextEditProvider.getNextEditableRegionsInTheCurrentChainLength() >
|
||||
0 &&
|
||||
!jumpSuccessful
|
||||
) {
|
||||
// Limit attempts
|
||||
// attempts++;
|
||||
const nextRegion =
|
||||
this.nextEditProvider.shiftNextEditableRegionsInTheCurrentChain();
|
||||
if (!nextRegion) continue;
|
||||
|
|
@ -472,7 +441,7 @@ export class ContinueCompletionProvider
|
|||
nextRegion.range.start.character,
|
||||
);
|
||||
|
||||
// Try to suggest a jump to this location
|
||||
// Try to suggest a jump to this location.
|
||||
jumpSuccessful = await this.jumpManager.suggestJump(
|
||||
currCursorPos,
|
||||
jumpPosition,
|
||||
|
|
@ -480,23 +449,24 @@ export class ContinueCompletionProvider
|
|||
);
|
||||
|
||||
if (jumpSuccessful) {
|
||||
// Store completion to be rendered after jump
|
||||
// Store completion to be rendered after jump.
|
||||
this.jumpManager.setCompletionAfterJump({
|
||||
completionId: completionId,
|
||||
outcome: outcome as NextEditOutcome,
|
||||
currentPosition: jumpPosition,
|
||||
});
|
||||
|
||||
return undefined; // Don't show anything yet
|
||||
return undefined; // Don't show anything yet!
|
||||
}
|
||||
}
|
||||
|
||||
// If no jump was successful after trying multiple locations,
|
||||
// proceed with other completion display logic or return undefined
|
||||
// proceed with other completion display logic or return undefined.
|
||||
if (!jumpSuccessful) {
|
||||
console.log(
|
||||
"No suitable jump location found after trying multiple positions",
|
||||
);
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue