Also called Suggest & complete
Padre knows two types of source code auto-complete:
- Manual Edit -> Autocomplete or pressing the hotkey Ctrl+Space
- Automatically while typing
Both of them are configurable using the Preference System Tools -> Preferences -> Perl Auto Complete
Options:
- Autocomplete always while typing
- Autocomplete new methods in packages
- Autocomplete new subroutines in scripts
- Minimum length of suggestions: 3
- Maximum number of suggestions: 20
- Minimum characters for autocompletition: 1
Only known keys of this hash are suggested within hash brackets.
Test
- Open any Perl source file
- begin typing a variable name used in that file
- Manual: Press Ctrl+P, Automatic: No need to press anything
- A dropdown list should pop up near the cursor suggesting the rest of the variable name
Implementation
Each document class should implement its own method called 'autocomplete'. For Perl here are the implementations:
TODO
This feature considers the local file as source for suggestions. A perltags file is used if the project has one.
- Suggest from overall word list if a hash has no known keys
- Enable creation of perltags files using the UI or automatically (the menu item from the Perl menu might not work properly)
- Support references ($www = WWW::Mechanize->new(); type $www-> to show a list of methods; type $www->{ to show a list of useable keys)
- Use all words from a project within all files of this project (configurable!!!)