I made the Code completion more forgiving. If you are as lazy as me and you do a lot of typos while coding you may like this IDE plugin I made. It replaces Pascal code completion matching algorithm with different implementation using Levenshtein distance to compute suggestions which is much more forgiving to misspelling.

I made the Code completion more forgiving. If you are as lazy as me and you do a lot of typos while coding you may like this IDE plugin I made. It replaces Pascal code completion matching algorithm with different implementation using Levenshtein distance to compute suggestions which is much more forgiving to misspelling.

It can replace things like:
TComponent(o).comstate -> TComponent(o).ComponentState
and even:
TComponent(o).Uatoon -> TComponent(o).UpdateAction

It completely disables suggestion filtering allowing you to see the whole list all the time and lets you see how suggestion changes as you type. This is an early alpha and a proof of concept example but I already found it helpful. Let me know if you run into any errors. It is tested mostly on XE7 and XE6!
https://bitbucket.org/shadow_cs/delphi-smart-code-completion/wiki/Home

Comments

  1. Which Delphi versions should it work with? Is there a chance for it to be Delphi 2007 compatible?

    ReplyDelete
  2. Neat! Any plans of releasing the source?

    ReplyDelete
  3. Thomas Mueller​ I guess so... Just have to find a compiler and try it ;-)

    ReplyDelete
  4. Nicholas Ring​ I'm thinking about that, I wanted some feedback before I figure out what to do next... I would be interested if some people find even better solution based on mine and maybe there could be an option to allow switching between multiple mechanisms

    ReplyDelete
  5. Releasing the source would be really great

    ReplyDelete
  6. Need to figure out some possible licensing issues first, then I probably release it under GPL.

    ReplyDelete
  7. GPL for an IDE plugin? If I understand the GPL correctly, that's not possible, because it would be illegal to load it into the proprietary IDE executable.

    ReplyDelete
  8. Is really loading into proprietary SW a problem? I want to guard the code so any modifications (and derived work) need to be made public. I need to go license hunting then ;-) Any suggestions?

    ReplyDelete
  9. Honza Rameš for your stated goal you should take MPL rather than GPL. MPL requires people who change the code to make their changes public. The GPL does not do such a thing. It requires people to give the source code to whoever they give a binary. So as long as somebody only makes changes he uses internally (in his company), he can keep them secret. The GPL in addition has some restrictions on where the code can be used. It's not allowed to add GPL code to a proprietary application, even loading a DLL with GPL code is not allowed. That's why there are licenses like the LGPL, that allow this.

    ReplyDelete
  10. But MPL allows the original code to be a base of a proprietary (possibly commercial product) or am I wrong? I always get the licenses mixed up :-D

    ReplyDelete
  11. Honza Rameš Yes, that's correct. Under MPL only changes to the sources must be published, but it is allowed to base a commercial product on them as long as the source isn't changed. The JEDI sources are under the MPL, so I can use them in my programs. But if I make changes to them, I must publish those changes.
    btw: GPL allows commercial products as well, you just have to give your customers the source code.

    ReplyDelete
  12. I just tested it. Not sure I like it, but maybe it's just me being used to the way Delphi does it by default. If I hadn't known, I would probably not even have noticed.

    ReplyDelete
  13. Yeah sometimes it looks kindof weird (behaved the way you don't expect if you are used to the default way) but on the other hand it finds the right suggestion even if you type something way of. More tweaking may be needed... But it also depends on what delphi offers under the hood and it is not always perfect.

    ReplyDelete
  14. I'd like to test it if you have a pkg for XE4 :) BTW, I'd like to see such feature to be integrated into CNPack's so called Input Helper, or is it possible to replace it? It's currently indispensable to me.

    ReplyDelete
  15. Are there any plans for a souce code release by now?

    ReplyDelete
  16. Don't think GPL would preclude you loading the covered into the IDE.

    ReplyDelete
  17. I decided to go for MPL, the sources can be found on the address below. I will send a new post about it in a while.
    bitbucket.org - shadow_cs / delphi-smart-code-completion

    ReplyDelete

Post a Comment