Class AbstractDeclarativeIdeQuickfixProvider
java.lang.Object
org.eclipse.xtext.ide.editor.quickfix.AbstractDeclarativeIdeQuickfixProvider
- All Implemented Interfaces:
IQuickFixProvider
@Beta
public class AbstractDeclarativeIdeQuickfixProvider
extends Object
implements IQuickFixProvider
- Since:
- 2.24
- Author:
- Heinrich Weichert
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected List<org.eclipse.lsp4j.TextEdit>
createTextEdit
(org.eclipse.lsp4j.Diagnostic diagnostic, String text) Creates a singleton list with only oneTextEdit
that replaces the region of the diagnostic with the given textgetFixMethods
(org.eclipse.lsp4j.Diagnostic diagnostic) getResolutions
(ICodeActionService2.Options options, org.eclipse.lsp4j.Diagnostic diagnostic) Collects all possible quickfixes for the given issue.boolean
handlesDiagnostic
(org.eclipse.lsp4j.Diagnostic diagnostic) If the provider handles (it has code to produce resolutions for) the given diagnostic.
-
Constructor Details
-
AbstractDeclarativeIdeQuickfixProvider
public AbstractDeclarativeIdeQuickfixProvider()
-
-
Method Details
-
getResolutions
public List<DiagnosticResolution> getResolutions(ICodeActionService2.Options options, org.eclipse.lsp4j.Diagnostic diagnostic) Description copied from interface:IQuickFixProvider
Collects all possible quickfixes for the given issue. If there are none, returns an empty list- Specified by:
getResolutions
in interfaceIQuickFixProvider
- Parameters:
options
- Contextual action optionsdiagnostic
- the diagnostic- Returns:
- 0..n resolutions for the given issue
-
handlesDiagnostic
public boolean handlesDiagnostic(org.eclipse.lsp4j.Diagnostic diagnostic) Description copied from interface:IQuickFixProvider
If the provider handles (it has code to produce resolutions for) the given diagnostic.- Specified by:
handlesDiagnostic
in interfaceIQuickFixProvider
- Parameters:
diagnostic
- the diagnostic- Returns:
- true if the provider handles the given diagnostic
-
getFixMethods
-
createTextEdit
protected List<org.eclipse.lsp4j.TextEdit> createTextEdit(org.eclipse.lsp4j.Diagnostic diagnostic, String text) Creates a singleton list with only oneTextEdit
that replaces the region of the diagnostic with the given text- Parameters:
diagnostic
- theDiagnostic
text
- the text- Returns:
- a singleton list with only one
TextEdit
- Since:
- 2.27
-