Module io.quarkus.qute.debug
Class CompletionSupport
java.lang.Object
io.quarkus.qute.debug.agent.completions.CompletionSupport
Provides support for code completions within the Qute template debugger.
This class is responsible for generating completion items for expressions at a given caret position inside a template, taking into account the current stack frame and the available variables, properties, and resolvers.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.eclipse.lsp4j.debug.CompletionItem[]Empty array used as default for completions. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCompletableFuture<org.eclipse.lsp4j.debug.CompletionsResponse> completions(org.eclipse.lsp4j.debug.CompletionsArguments args) Computes code completions for a given template expression and caret position.static StringextractReceiverBeforeCaret(String expression, int caretOffset) Extracts the receiver expression before the caret for code completion purposes.
-
Field Details
-
EMPTY_COMPLETION_ITEMS
public static final org.eclipse.lsp4j.debug.CompletionItem[] EMPTY_COMPLETION_ITEMSEmpty array used as default for completions.
-
-
Constructor Details
-
CompletionSupport
-
-
Method Details
-
completions
public CompletableFuture<org.eclipse.lsp4j.debug.CompletionsResponse> completions(org.eclipse.lsp4j.debug.CompletionsArguments args) Computes code completions for a given template expression and caret position.- Parameters:
args- the completion arguments containing frameId, text, column- Returns:
- a CompletableFuture resolving to a
CompletionsResponsecontaining possible completions
-
extractReceiverBeforeCaret
Extracts the receiver expression before the caret for code completion purposes.Examples:
- "items.get(items.
size)" → returns "items" - "items.size > 10 invalid input: '&'invalid input: '&' items.
" → returns "items" - "items.foo.bar.in
dex" → returns "items.foo.bar"
- Parameters:
expression- the full expression from the templatecaretOffset- the caret position where completion is invoked- Returns:
- the receiver expression before the caret, or null if none
- "items.get(items.
-