Class RNCCompletionContext
java.lang.Object
org.eclipse.lemminx.extensions.relaxng.grammar.rnc.completion.RNCCompletionContext
Determines the completion context at a given cursor position in an RNC
document by scanning all tokens before the cursor.
Use case: RNCCompletions calls getCompletionContext(CharSequence, int)
to decide which set of completion items to offer — top-level declarations,
pattern keywords, namespace URIs, file paths, etc.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumDescribes the context in which completion was triggered. -
Method Summary
Modifier and TypeMethodDescriptiongetCompletionContext(CharSequence text, int offset) Determines the completion context by scanning all tokens before the cursor.
-
Method Details
-
getCompletionContext
public static RNCCompletionContext.CompletionContextType getCompletionContext(CharSequence text, int offset) Determines the completion context by scanning all tokens before the cursor.Implements a state machine that tracks the last meaningful token, whether we are inside a
namespaceordatatypesdeclaration, and the current brace nesting depth.- Parameters:
text- the full document text.offset- the cursor offset.- Returns:
- the detected
RNCCompletionContext.CompletionContextType.
-