@sourceacademy/autocomplete
    Preparing search index...

    Class BaseAutoCompleteRunnerPluginAbstract

    This plugin provides autocomplete suggestions and syntax highlighting.

    It provides two channels: one for autocomplete requests and responses, and another for sending syntax highlighting information to the web plugin.

    • The autocomplete channel listens for requests containing the current code and cursor position. It uses the resolver to find relevant symbols based on the cursor position and sends back a response with the autocomplete suggestions.
    • The syntax highlighting channel periodically sends the mode information to the web plugin until it receives an acknowledgment, ensuring that the web plugin has the necessary information to perform syntax highlighting.

    Implements

    • IPlugin
    Index

    Constructors

    Properties

    Accessors

    Methods

    Constructors

    Properties

    id: string = RUNNER_PLUGIN_ID

    The id of the plugin.

    channelAttach: string[] = ...

    Accessors

    • The mode property should return the syntax highlighting data for the Ace Editor mode, which includes information about keywords, operators, and other syntax elements.
      This data is sent to the web plugin to enable proper syntax highlighting of code.

      Returns SyntaxHighlightData

    Methods

    • The autocomplete method should return a list of autocomplete suggestions based on the provided code and cursor position.

      Parameters

      • code: string

        The current code in the editor.

      • row: number

        The current row of the cursor in the editor (1-indexed)

      • column: number

        The current column of the cursor in the editor (1-indexed)

      Returns AutoCompleteEntry[]

      A list of autocomplete entries relevant to the current cursor position in the code.