-
Notifications
You must be signed in to change notification settings - Fork 34.6k
Closed
Labels
apieditor-code-actionsEditor inplace actions (Ctrl + .)Editor inplace actions (Ctrl + .)feature-requestRequest for new features or functionalityRequest for new features or functionalityunder-discussionIssue is under discussion for relevance, priority, approachIssue is under discussion for relevance, priority, approach
Description
Part of #33555
Problem
Code actions are currently just a list of Command
. These commands provide have no information about what the code action actually does. We'd like to be able to do the following:
- Sort code actions so that fixes for errors show up first
- Group code actions by type / by the error they fix
- Provide a better UI for code actions that tells users which actions address which problems in the code
Proposal
Introduce a new CodeAction
interface that defines additional information about a code action. To start, I propose we add two additional field to this interface: a type and a list of diagnostics:
enum class CodeActionType {
// Standard type. Would be used for existing CodeActionProviders that return Commands
Default = 0 ,
// Fixes a diagnostic in the CodeActionContext
QuickFix = 1,
// Perform a refactorng
Refactoring =2
}
interface CodeAction {
// Command the performs the action
command: Command
type: CodeActionType
// List of diagnostics this code action resolves
diagnostics?: Diagnostic[]
}
// cc @jrieken
Metadata
Metadata
Assignees
Labels
apieditor-code-actionsEditor inplace actions (Ctrl + .)Editor inplace actions (Ctrl + .)feature-requestRequest for new features or functionalityRequest for new features or functionalityunder-discussionIssue is under discussion for relevance, priority, approachIssue is under discussion for relevance, priority, approach