public class CodeActionFactory extends Object
CodeAction
Constructor and Description |
---|
CodeActionFactory() |
Modifier and Type | Method and Description |
---|---|
static org.eclipse.lsp4j.CodeAction |
createCommand(String title,
String commandId,
List<Object> commandParams,
org.eclipse.lsp4j.Diagnostic diagnostic)
Makes a CodeAction to call a command from the available server commands.
|
static org.eclipse.lsp4j.CodeAction |
createFile(String title,
String docURI,
String content,
org.eclipse.lsp4j.Diagnostic diagnostic)
Makes a CodeAction to create a file and add content to the file.
|
static org.eclipse.lsp4j.CodeAction |
insert(String title,
org.eclipse.lsp4j.Position position,
String insertText,
org.eclipse.lsp4j.TextDocumentItem document,
org.eclipse.lsp4j.Diagnostic diagnostic)
Create a CodeAction to insert a new content at the end of the given range.
|
static org.eclipse.lsp4j.TextEdit |
insertEdit(String insertText,
org.eclipse.lsp4j.Position position) |
static org.eclipse.lsp4j.TextDocumentEdit |
insertEdit(String insertText,
org.eclipse.lsp4j.Position position,
org.eclipse.lsp4j.TextDocumentItem document)
Returns the text edit to insert a new content at the end of the given range.
|
static org.eclipse.lsp4j.TextDocumentEdit |
insertEdits(org.eclipse.lsp4j.TextDocumentItem document,
List<org.eclipse.lsp4j.TextEdit> edits) |
static org.eclipse.lsp4j.CodeAction |
remove(String title,
org.eclipse.lsp4j.Range range,
org.eclipse.lsp4j.TextDocumentItem document,
org.eclipse.lsp4j.Diagnostic diagnostic)
Create a CodeAction to remove the content from the given range.
|
static org.eclipse.lsp4j.CodeAction |
replace(String title,
List<org.eclipse.lsp4j.TextEdit> replace,
org.eclipse.lsp4j.TextDocumentItem document,
org.eclipse.lsp4j.Diagnostic diagnostic) |
static org.eclipse.lsp4j.CodeAction |
replace(String title,
org.eclipse.lsp4j.Range range,
String replaceText,
org.eclipse.lsp4j.TextDocumentItem document,
org.eclipse.lsp4j.Diagnostic diagnostic) |
static org.eclipse.lsp4j.CodeAction |
replaceAt(String title,
String replaceText,
org.eclipse.lsp4j.TextDocumentItem document,
org.eclipse.lsp4j.Diagnostic diagnostic,
Collection<org.eclipse.lsp4j.Range> ranges) |
public static org.eclipse.lsp4j.CodeAction remove(String title, org.eclipse.lsp4j.Range range, org.eclipse.lsp4j.TextDocumentItem document, org.eclipse.lsp4j.Diagnostic diagnostic)
title
- range
- document
- diagnostic
- public static org.eclipse.lsp4j.CodeAction insert(String title, org.eclipse.lsp4j.Position position, String insertText, org.eclipse.lsp4j.TextDocumentItem document, org.eclipse.lsp4j.Diagnostic diagnostic)
title
- range
- insertText
- document
- diagnostic
- public static org.eclipse.lsp4j.TextDocumentEdit insertEdit(String insertText, org.eclipse.lsp4j.Position position, org.eclipse.lsp4j.TextDocumentItem document)
insertText
- text to insert.position
- the position.document
- the text document.public static org.eclipse.lsp4j.TextEdit insertEdit(String insertText, org.eclipse.lsp4j.Position position)
public static org.eclipse.lsp4j.TextDocumentEdit insertEdits(org.eclipse.lsp4j.TextDocumentItem document, List<org.eclipse.lsp4j.TextEdit> edits)
public static org.eclipse.lsp4j.CodeAction replace(String title, org.eclipse.lsp4j.Range range, String replaceText, org.eclipse.lsp4j.TextDocumentItem document, org.eclipse.lsp4j.Diagnostic diagnostic)
public static org.eclipse.lsp4j.CodeAction replace(String title, List<org.eclipse.lsp4j.TextEdit> replace, org.eclipse.lsp4j.TextDocumentItem document, org.eclipse.lsp4j.Diagnostic diagnostic)
public static org.eclipse.lsp4j.CodeAction replaceAt(String title, String replaceText, org.eclipse.lsp4j.TextDocumentItem document, org.eclipse.lsp4j.Diagnostic diagnostic, Collection<org.eclipse.lsp4j.Range> ranges)
public static org.eclipse.lsp4j.CodeAction createFile(String title, String docURI, String content, org.eclipse.lsp4j.Diagnostic diagnostic)
title
- The displayed name of the CodeActiondocURI
- The file to createcontent
- The text to put into the newly created document.diagnostic
- The diagnostic that this CodeAction will fixpublic static org.eclipse.lsp4j.CodeAction createCommand(String title, String commandId, List<Object> commandParams, org.eclipse.lsp4j.Diagnostic diagnostic)
title
- The displayed name of the CodeActioncommandId
- The id of the given command to add as CodeActioncommandParams
- The document URI of the document the command is called ondiagnostic
- The diagnostic that this CodeAction will fixCopyright © 2021. All rights reserved.