Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/extension/inlineEdits/node/nextEditProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,13 +305,15 @@ export class NextEditProvider extends Disposable implements INextEditProvider<Ne
assert(currentDocument !== undefined, 'should be defined if edit is defined');

telemetryBuilder.setStatus('notAccepted'); // Acceptance pending.

const showRangePreference = this._statelessNextEditProvider.showNextEditPreference ?? ShowNextEditPreference.AroundEdit;

let nextEditResult: NextEditResult;
if (!showLabel || selections.length < 1) {
const currentSelection = selections.at(0);
if (!showLabel || currentSelection === undefined) {
nextEditResult = new NextEditResult(logContext.requestId, req, { edit, showRangePreference, documentBeforeEdits: currentDocument, targetDocumentId });
} else {
const transformer = documentAtInvocationTime.getTransformer();
const currentSelection = selections[0];
const currentCursorPosition = transformer.getRange(currentSelection);

const editPosition = transformer.getRange(edit.replaceRange);
Expand All @@ -325,6 +327,7 @@ export class NextEditProvider extends Disposable implements INextEditProvider<Ne
const displayLocation: INextEditDisplayLocation = {
label,
range: currentCursorPosition,
jumpToEdit: true,
};

const commandJumpToEditRange: vscode.Command = {
Expand Down
1 change: 1 addition & 0 deletions src/extension/inlineEdits/node/nextEditResult.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { NextEditFetchRequest } from './nextEditProvider';
export interface INextEditDisplayLocation {
range: Range;
label: string;
jumpToEdit?: boolean;
}

export interface INextEditResult {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,8 @@ export class InlineCompletionProviderImpl implements InlineCompletionItemProvide
const displayLocation: InlineCompletionDisplayLocation | undefined = result.displayLocation && displayLocationRange ? {
range: displayLocationRange,
label: result.displayLocation.label,
kind: InlineCompletionDisplayLocationKind.Code
kind: InlineCompletionDisplayLocationKind.Code,
jumpToEdit: result.displayLocation.jumpToEdit
} : undefined;


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ declare module 'vscode' {
range: Range;
kind: InlineCompletionDisplayLocationKind;
label: string;
jumpToEdit?: boolean;
}

export interface InlineCompletionWarning {
Expand Down
4 changes: 3 additions & 1 deletion src/extension/xtab/node/xtabProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,9 @@ export class XtabProvider implements IStatelessNextEditProvider {
}

const diffOptions: ResponseProcessor.DiffParams = {
emitFastCursorLineChange: this.configService.getExperimentBasedConfig(ConfigKey.Internal.InlineEditsXtabProviderEmitFastCursorLineChange, this.expService),
emitFastCursorLineChange: opts.showLabel
? false
: this.configService.getExperimentBasedConfig(ConfigKey.Internal.InlineEditsXtabProviderEmitFastCursorLineChange, this.expService),
nLinesToConverge: this.configService.getExperimentBasedConfig(ConfigKey.Internal.InlineEditsXtabNNonSignificantLinesToConverge, this.expService),
nSignificantLinesToConverge: this.configService.getExperimentBasedConfig(ConfigKey.Internal.InlineEditsXtabNSignificantLinesToConverge, this.expService),
};
Expand Down