andreikop / qutepart

Code editor component for PyQt5
http://enki-editor.org
GNU Lesser General Public License v2.1
113 stars 29 forks source link

Improve Completer #74

Closed sscherfke closed 6 years ago

sscherfke commented 6 years ago

This PR adds two new features to the built-in completer:

  1. Extract the list of keywords from a language definition and add them to the completer’s keywords. This would, for example, allow auto-completion of Python exceptions, built-ins and keywords.

  2. Let the user define an additional set of completions. This is especially useful if you have an editor for keyword-less languages with a fixed structure, e.g. YAML files for Ansible or Travis (qpart.setCustomCompletions({'sudo', 'addons', 'sources', 'matrix', 'os'})).

Both sets of completions are managed independently (from another and from the completions derived from the current document). So the custom completions “survive” if you change the language definition or the change of the entire document. You can also reset the custom completions at any time (qpart.setCustomCompletions(set())).

andreikop commented 6 years ago

Hi

This PR looks like mergable, but has WIP in the title. Should I merge it or are you going to add something for it?

sscherfke commented 6 years ago

No longer WIP. I tested the changes at work and they work quite well. :-)