MLIR  19.0.0git
Public Attributes | Static Public Attributes | List of all members
mlir::lsp::CodeAction Struct Reference

A code action represents a change that can be performed in code, e.g. More...

#include "mlir/Tools/lsp-server-support/Protocol.h"

Public Attributes

std::string title
 A short, human-readable, title for this code action. More...
 
std::optional< std::string > kind
 The kind of the code action. More...
 
std::optional< std::vector< Diagnostic > > diagnostics
 The diagnostics that this code action resolves. More...
 
bool isPreferred = false
 Marks this as a preferred action. More...
 
std::optional< WorkspaceEditedit
 The workspace edit this code action performs. More...
 

Static Public Attributes

static const llvm::StringLiteral kQuickFix = "quickfix"
 
static const llvm::StringLiteral kRefactor = "refactor"
 
static const llvm::StringLiteral kInfo = "info"
 

Detailed Description

A code action represents a change that can be performed in code, e.g.

to fix a problem or to refactor code.

A CodeAction must set either edit and/or a command. If both are supplied, the edit is applied first, then the command is executed.

Definition at line 1212 of file Protocol.h.

Member Data Documentation

◆ diagnostics

std::optional<std::vector<Diagnostic> > mlir::lsp::CodeAction::diagnostics

The diagnostics that this code action resolves.

Definition at line 1224 of file Protocol.h.

Referenced by mlir::lsp::toJSON().

◆ edit

std::optional<WorkspaceEdit> mlir::lsp::CodeAction::edit

The workspace edit this code action performs.

Definition at line 1234 of file Protocol.h.

Referenced by mlir::lsp::toJSON().

◆ isPreferred

bool mlir::lsp::CodeAction::isPreferred = false

Marks this as a preferred action.

Preferred actions are used by the auto fix command and can be targeted by keybindings. A quick fix should be marked preferred if it properly addresses the underlying error. A refactoring should be marked preferred if it is the most reasonable choice of actions to take.

Definition at line 1231 of file Protocol.h.

Referenced by mlir::lsp::toJSON().

◆ kind

std::optional<std::string> mlir::lsp::CodeAction::kind

The kind of the code action.

Used to filter code actions.

Definition at line 1218 of file Protocol.h.

Referenced by mlir::lsp::toJSON().

◆ kInfo

const llvm::StringLiteral CodeAction::kInfo = "info"
static

Definition at line 1221 of file Protocol.h.

◆ kQuickFix

const llvm::StringLiteral CodeAction::kQuickFix = "quickfix"
static

Definition at line 1219 of file Protocol.h.

◆ kRefactor

const llvm::StringLiteral CodeAction::kRefactor = "refactor"
static

Definition at line 1220 of file Protocol.h.

◆ title

std::string mlir::lsp::CodeAction::title

A short, human-readable, title for this code action.

Definition at line 1214 of file Protocol.h.

Referenced by mlir::lsp::toJSON().


The documentation for this struct was generated from the following files: