public abstract class SourceCodeAnalysis
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
SourceCodeAnalysis.Completeness
Describes the completeness of the given input.
|
static class |
SourceCodeAnalysis.CompletionInfo
The result of
analyzeCompletion(String input) . |
static class |
SourceCodeAnalysis.Suggestion
A candidate for continuation of the given user's input.
|
Constructor and Description |
---|
SourceCodeAnalysis() |
Modifier and Type | Method and Description |
---|---|
abstract SourceCodeAnalysis.CompletionInfo |
analyzeCompletion(java.lang.String input)
Given an input string, find the first snippet of code (one statement,
definition, import, or expression) and evaluate if it is complete.
|
abstract java.util.List<SourceCodeAnalysis.Suggestion> |
completionSuggestions(java.lang.String input,
int cursor,
int[] anchor)
Compute possible follow-ups for the given input.
|
abstract java.lang.String |
documentation(java.lang.String input,
int cursor)
Compute a description/help string for the given user's input.
|
public abstract SourceCodeAnalysis.CompletionInfo analyzeCompletion(java.lang.String input)
input
- the input source stringpublic abstract java.util.List<SourceCodeAnalysis.Suggestion> completionSuggestions(java.lang.String input, int cursor, int[] anchor)
JShell
state, including
type information, to filter the suggestions.input
- the user input, so farcursor
- the current position of the cursors in the given input
textanchor
- outgoing parameter - when an option will be completed, the text between
the anchor and cursor will be deleted and replaced with the given optionpublic abstract java.lang.String documentation(java.lang.String input, int cursor)
input
- the snippet the user wrote so farcursor
- the current position of the cursors in the given input
text