Table of Contents

TScripterCodeInsight.GetCodeCompletion Method

Builds a string list containing code completion suggestions related to a input string AInputText (source code) and an cursor position (AInputPos).

Syntax

Unit: atScript

function TScripterCodeInsight.GetCodeCompletion(AInputPos: Integer; var DefaultIndex: Integer): TStringList;

Parameters

<-> Parameter Type Description
AInputPos Integer The current cursor position in the input text in which code completion will be displayed
var DefaultIndex Integer The suggested index of the completion list to be selected. This is only calculated if Context property is set.

Returns

A TStrings list containing the code completion suggestions. You must be sure to destroy this list after using it. Important: in the Objects part of the list there is a reference to the script object related to the list For example, if the list item is 'MyForm.Caption', it relates to a property of a caption. So the object related to this item points to the TatProperty object related to the 'Caption' property. The types of objects that can be in the Objects property are the following. TatMethod (for methods) TatProperty (for properties) TatVariableInfo (for script variables) TatRoutineInfo (for script routines) If you want different info to be provided in the Objects section, see CreateCodeCompletionList method

See also