static Sandbox.ConCmdAttribute/AutoCompleteResult[] AutoComplete( string text, int maxCount )

robot_2Generated
code_blocksInput

Description

The AutoComplete method in the Editor.EditorUtility class provides a way to generate autocomplete suggestions based on a given input text. This method is useful for implementing command-line interfaces or text input fields where users can benefit from suggestions as they type.

Usage

To use the AutoComplete method, call it with the text you want to generate suggestions for and specify the maximum number of suggestions you want to receive. The method will return an array of AutoCompleteResult objects, each representing a possible completion for the input text.

Example

// Example usage of the AutoComplete method
string inputText = "comm";
int maxSuggestions = 5;

Sandbox.ConCmdAttribute.AutoCompleteResult[] suggestions = Editor.EditorUtility.AutoComplete(inputText, maxSuggestions);

foreach (var suggestion in suggestions)
{
    // Process each suggestion
    Console.WriteLine(suggestion.Text);
}