@@ -565,6 +565,102 @@ Choose a handler to go to that handler in the script.
565565
566566The Window menu contains the names of open script editor windows.
567567
568+ ### Autocomplete
569+
570+ > ** Note:** Autocomplete is only available in commercial versions of
571+ LiveCode
572+
573+ #### Using Autocomplete
574+
575+ While typing in the script editor a filtered list of available completions
576+ will appear below the selection. Use the following keys to navigate the
577+ completion list:
578+
579+ - tab - apply the completion
580+ - up arrow - move up the list
581+ - down arrow - move down the list
582+
583+ Moving the mouse will hide the completion list to avoid it remaining in
584+ place over an area you would like to select. Completions include
585+ placeholder fields which you can navigate with the tab key. Some
586+ completions may have multiple placeholders with the same name which
587+ will be edited together. Clicking within a placeholder will select it.
588+
589+ The current automatic completion of control structures has not changed.
590+
591+ Autocomplete provides the following features:
592+
593+ - Completions generated from the LiveCode documentation
594+ - Completions generated dynamically by introspecting
595+ the object being edited and its message path
596+ - An Autocomplete Snippet Manager dialog is accessible from the script
597+ editor menubar to manage a custom set of completions.
598+
599+ #### Autocomplete Snippet Manager
600+
601+ An autocomplete snippet provides the information required to match and
602+ complete some code in the script editor. The Autocomplete Snippet Manager
603+ allows the user to manage a custom set of completion snippets.
604+
605+ Create a new completion snippet by clicking the ** +** icon and delete the
606+ currently selected snippet by clicking the ** -** icon.
607+
608+ The dialog allows entry of the following:
609+
610+ ** Display Name** - choose a completion snippet to edit or change the
611+ display name of the current snippet.
612+
613+ ** Priority** - A value between 1 and 100 indicating the order the
614+ completions should be matched in. Higher priorities will be listed
615+ before lower priorities.
616+
617+ ** Match Scope** - Choose whether the completion should try and match when
618+ the selection is outside a handler, inside a handler or anywhere. A
619+ comment completion might be anywhere, a statement completion (unless
620+ local, global or constant) would be only inside a handler and a handler
621+ completion would be outside a handler.
622+
623+ ** Match Words** - Choose whether to match only all the words of a line,
624+ just the word being written or either. A statement would be all the words
625+ on a line, an expression would be just the current word and a comment
626+ would be either.
627+
628+ ** Alternate Match String** - When matching completion snippets the text
629+ of the completion is matched first but in some cases that is not suitable
630+ or another string would be better to match. Enter a string to try matching
631+ if the completion fails to match.
632+
633+ ** Summary** - This field is optional and provides some detail below the
634+ completion in the script editor.
635+
636+ ** Completion** - This is the string to be used when replacing the
637+ selection after choosing a completion. The completion may be any script
638+ and any length. Add placeholders to the completion in the following form:
639+
640+ ${<name>:<type>}
641+
642+ Where:
643+
644+ - name - is the text seen in the script editor
645+ - type - is used to filter the completions presented for the placeholder
646+ one of:
647+
648+ - statement - any LiveCode command
649+ - expression - any LiveCode expression
650+ - identifier - a variable or handler name
651+
652+ Additionally, it is possible to include multiple placeholders with the
653+ same name. When a multiple placeholder is selected they are edited
654+ at the same time. In this example completion as the user enters the
655+ condition a comment is appended to the ` end if ` with the condition text.
656+ Once the condition is complete the user may tab to the ` -- code ` line
657+ and enter a statement. The tab order is always top to bottom and left to
658+ right:
659+
660+ if ${condition:expression} then
661+ ${-- code:statement}
662+ end if # ${condition}
663+
568664## The Message Box
569665
570666The Message Box is a command line tool that allows you to run scripts or
0 commit comments