Class CompletionSupport

java.lang.Object
io.quarkus.qute.debug.agent.completions.CompletionSupport

public class CompletionSupport extends Object
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 Details

    • EMPTY_COMPLETION_ITEMS

      public static final org.eclipse.lsp4j.debug.CompletionItem[] EMPTY_COMPLETION_ITEMS
      Empty array used as default for completions.
  • Constructor Details

    • CompletionSupport

      public CompletionSupport(DebuggeeAgent agent)
  • 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 CompletionsResponse containing possible completions
    • extractReceiverBeforeCaret

      public static String extractReceiverBeforeCaret(String expression, int caretOffset)
      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.index" → returns "items.foo.bar"

      Parameters:
      expression - the full expression from the template
      caretOffset - the caret position where completion is invoked
      Returns:
      the receiver expression before the caret, or null if none