Package io.deephaven.lang.completion
Class CompletionRequest
- java.lang.Object
-
- io.deephaven.lang.completion.CompletionRequest
-
public class CompletionRequest extends java.lang.ObjectA stateful object to represent a document search at a given position. When we search left or right from an intermediate node like whitespace, dot, comma or EOF, we will create a new CompletionRequest at the new index. This currently uses absolute cursor positions, but we want this to be a line/column position instead, so we can completely remove consideration of absolute cursors. This mistake was made by trying to base V2 on V1 semantics which are not really relevant when considering Monaco, LSP and Javacc which all use line/column semantics. Absolute cursor positions are unfortunately deeply entwined inChunkerCompleter, so we are leaving it in place for now. Note that this class also maintains a map of loaded table definitions, so that repeated completions will not pay to load the same table definition more than once.
-
-
Constructor Summary
Constructors Constructor Description CompletionRequest(ChunkerCompleter completer, java.lang.String command, int offset)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CompletionRequestcandidate(int index)java.lang.StringgetBeforeCursor()intgetCandidate()intgetOffset()java.lang.StringgetSource()io.deephaven.engine.table.TableDefinitiongetTableDefinition(ChunkerCompleter completer, io.deephaven.lang.parse.ParsedDocument doc, io.deephaven.engine.util.VariableProvider variables, java.lang.String name)java.lang.StringtoString()
-
-
-
Constructor Detail
-
CompletionRequest
public CompletionRequest(@NotNull ChunkerCompleter completer, java.lang.String command, int offset)
-
-
Method Detail
-
getSource
public java.lang.String getSource()
-
getOffset
public int getOffset()
-
getBeforeCursor
public java.lang.String getBeforeCursor()
-
getCandidate
public int getCandidate()
-
candidate
public CompletionRequest candidate(int index)
-
getTableDefinition
public io.deephaven.engine.table.TableDefinition getTableDefinition(ChunkerCompleter completer, io.deephaven.lang.parse.ParsedDocument doc, io.deephaven.engine.util.VariableProvider variables, java.lang.String name)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-