Class CompletionPrefixProvider

  • Direct Known Subclasses:
    IndentationAwareCompletionPrefixProvider

    public class CompletionPrefixProvider
    extends java.lang.Object
    Small utility to extract the parsable content of a document when content assist is invoked at a given location.
    Since:
    2.13
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getInputToParse​(java.lang.String completeInput, int offset, int completionOffset)
      Standard languages only need to parse the text up to the last hidden token sequence in the document.
      org.eclipse.xtext.nodemodel.INode getLastCompleteNodeByOffset​(org.eclipse.xtext.nodemodel.INode node, int offsetPosition, int completionOffset)
      Returns the last node that appears to be part of the prefix.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CompletionPrefixProvider

        public CompletionPrefixProvider()
    • Method Detail

      • getInputToParse

        public java.lang.String getInputToParse​(java.lang.String completeInput,
                                                int offset,
                                                int completionOffset)
        Standard languages only need to parse the text up to the last hidden token sequence in the document. Thus the string from start to the normalized offset is sufficient.
      • getLastCompleteNodeByOffset

        public org.eclipse.xtext.nodemodel.INode getLastCompleteNodeByOffset​(org.eclipse.xtext.nodemodel.INode node,
                                                                             int offsetPosition,
                                                                             int completionOffset)
        Returns the last node that appears to be part of the prefix. This will be used to determine the current model object that'll be the most special context instance in the proposal provider.