Change to KTextEditor code completion interface
Hamish Rodda <[email protected]>
| Newsgroups | gmane.comp.kde.devel.quanta |
|---|---|
| Message-ID | <[email protected]> |
Hi, I've recently removed the old completion provider interface in favour of a QAbstractItemModel - based code completion. The new interface offers several advantages, including better handling for the user (no more unexpected keystroke consumption); user-controlled sorting, filtering, and grouping options; inbuilt and arbitrary syntax highlighting; etc. Unfortunately in my porting I missed that Quanta was actually using the old interface. I've started on porting Quanta to the new interface, but I have a few questions: 1) Invocation of code completion. This is now handled in three ways: a) automatic invocation, when the user types specific text b) manual invocation, when the user types a shortcut, and c) 3rd party invocation, eg. if Quanta specifically requests a code completion to be shown. Currently you're using your own system to provide invocation, which under the new scheme would be c). However I'm guessing that you might be interested in using the inbuilt invocation now? Currently it is implemented with regexps for finding the start and end of the range of text to be completed - the new code needs to know where the text to be completed against starts and finishes. I was thinking of enabling completion models to supply their own regexps for detecting valid ranges of text to be completed, or even having a virtual function which can be called to provide this detection. Here are the inbuild regexps as they stand at the moment: word start: "\b([_\w]+)$", word end: "^([_\w]*)\b". I guess they might be a bit too programming-specific in comparison to what you need. Alternatively you could stay with your current system and use option c), but that would limit the ability for other completion providers to peacefully coexist (not that I can really see a good use case for it, but...) 2) actually, it's just the invocation issue now :) Let me know what you think... Cheers, Hamish. _______________________________________________ quanta-devel mailing list [email protected] https://mail.kde.org/mailman/listinfo/quanta-devel
signature.asc
(application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) iD8DBQBFUsawH8BtnSmIlUYRAum5AJsGc9ED97tnXPdjQcTHRWPHKPuuBQCeM7QK odtVHminX5zwKHJKaxqJs3A= =mnyS -----END PGP SIGNATURE-----