Class CompletionRequest


  • public class CompletionRequest
    extends java.lang.Object
    A 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 in ChunkerCompleter, 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 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()
      • 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:
        toString in class java.lang.Object