diff --git a/src/vs/editor/contrib/codeAction/browser/codeAction.ts b/src/vs/editor/contrib/codeAction/browser/codeAction.ts index fc5b2cb033c91..050639f1a4538 100644 --- a/src/vs/editor/contrib/codeAction/browser/codeAction.ts +++ b/src/vs/editor/contrib/codeAction/browser/codeAction.ts @@ -130,7 +130,7 @@ export async function getCodeActions( return emptyCodeActionsResponse; } - const filteredActions = (providedCodeActions?.actions || []).filter(action => action && filtersAction(filter, action, model, rangeOrSelection)); + const filteredActions = (providedCodeActions?.actions || []).filter(action => action && filtersAction(filter, action)); const documentation = getDocumentationFromProvider(provider, filteredActions, filter.include); return { actions: filteredActions.map(action => new CodeActionItem(action, provider)), diff --git a/src/vs/editor/contrib/codeAction/common/types.ts b/src/vs/editor/contrib/codeAction/common/types.ts index 4f0d8e0f17156..19a690e23dceb 100644 --- a/src/vs/editor/contrib/codeAction/common/types.ts +++ b/src/vs/editor/contrib/codeAction/common/types.ts @@ -7,10 +7,7 @@ import { CancellationToken } from 'vs/base/common/cancellation'; import { onUnexpectedExternalError } from 'vs/base/common/errors'; import { Position } from 'vs/editor/common/core/position'; import * as languages from 'vs/editor/common/languages'; -import { ITextModel } from 'vs/editor/common/model'; import { ActionSet } from 'vs/platform/actionWidget/common/actionWidget'; -import { Range } from 'vs/editor/common/core/range'; -import { Selection } from 'vs/editor/common/core/selection'; export class CodeActionKind { private static readonly sep = '.'; @@ -98,7 +95,7 @@ export function mayIncludeActionsOfKind(filter: CodeActionFilter, providedKind: return true; } -export function filtersAction(filter: CodeActionFilter, action: languages.CodeAction, model: ITextModel, rangeOrSelection: Range | Selection): boolean { +export function filtersAction(filter: CodeActionFilter, action: languages.CodeAction): boolean { const actionKind = action.kind ? new CodeActionKind(action.kind) : undefined; // Filter out actions by kind @@ -127,11 +124,6 @@ export function filtersAction(filter: CodeActionFilter, action: languages.CodeAc } } - // On empty lines and selections, show only code AI code actions - if (rangeOrSelection.isEmpty() && model.getLineContent(rangeOrSelection.startLineNumber).length === 0) { - return !!action.isAI; - } - return true; }