I don’t usually post updates of my plugin here; however, I think this release can potentially attract a wider audience.
The plugin normally revolves only around a language called progress/open edge, you can learn everything about it here : http://jcaillon.github.io/3P.

A replacement for the default auto completion

In addition to the features targeting the openedge users, 3P now also include a new global feature :
It can completely replace the default autocompletion of notepad++ (more precisely scintilla) by the one used in 3P.

How does it look

When typing in a simple text :

In a file known by notepad++ (i.e. with keywords defined) :

Why replacing the default autocompletion?

Several reasons :

I’ve been using notepad++ for more than 10 years now, the autocompletion hasn’t changed a bit since the beginning. Don’t get me wrong, it is pretty ok (was even super cool when I started using notepad++), but I’ve used a lot a recent IDE (visual and every IDE from jetbrain) and I now find it pretty lackluster and not really enjoyable

Typing something in a big file with the autocompletion on slows down notepad++ by a lot (imho due to the usage of a simple scroll list in the scintilla autocompletion which has a lot of trouble displaying more than a thousand items)

And finally, because there are no normal ways of disabling the default autocompletion. So if you implement your own autocompletion, your user either has to deactivate the default autocompletion or bare 2 autocompletion each time he types something…

What can be suggested?

For now (v1.7.4), there are two types of words that can be suggested :

**Words extracted from the current text : **

You can choose to extract numbers

You can choose the minimum length for words extracted

You can choose which characters are considered part of a word

it uses the notepad++ option in Delimiter -> Add your characters

and if you are on a file with an autocompletion xml (in plugins\APIs), it also uses the additionalWordChar field (see here for more info)

**Keywords known by notepad++ : **

First it takes the keywords defined in the autocompletion xml for the current xml (in plugins\APIs)

Then it either takes the keywords from the lang.xml or the UserDefinedLang.xml, depending on the current language

Options

A noteworthy option is the ability to automatically insert the current suggestion when a non-word-character is typed. This is very similar to the autocompletion offered by the visual studio + resharper combo and allows to write code very quickly.

Screenshot of the available options (v1.7.3) :

Note : the screenshot is actually obsolete, find more options in the release.

Future plan

If this proves to be useful, I could extend the functionality by either using new config files (like the api .xml) or just enhancing the .xml files from the api to hold more information (maybe an html help/description of each keyword; adding “child” keywords for class liek keywords… I don’t know yet :))

Anyway…
I hope this can be useful to you guys; feedback is welcomed !
++

Ah, yes I’m aware of that issue #86; I’ve developped my own UI framework for this plugin and I’ve made the rookie mistake of ignoring dpi awareness ^^". That being said, the auto completion is entirely owner drawn so I will be able to make the font size an option in a later release

Concerning your final question : yes, for now, this is tied to 3P. However, I plan to create a separate plugin with only this autocompletion feature once it is mature and stable enough inside 3P.

I started testing again this morning - at first it wasn’t triggering at all! I restarted npp, still wasn’t triggering.
It finally started triggering and this time it worked as expected and replaced the original text! (I will try to test this more to see why it wasn’t triggering and I’ll post back)

Ok, optimistic news… I hope you can get to it sooner than later… :)

Ok, that would be great because I don’t even know what Progress programming is… :)

@jcaillon - After a bunch of testing, I think I found the the problem of the triggering!

Steps to reproduce:

Open fresh npp

Place cursor on a line that doesn’t have text

Start typing - auto-complete does not trigger

Now place cursor on a line with text

Start typing - Autocomplete triggers as expected.

I haven’t the slightest idea why this would be, but that was the results of my testing - I leave the rest up to you :)

However, after testing some more, I realized another thing, If I open a new file and then go back to the original file, the autocomplete triggers as expected even on a line that has no text.

Just to clarify: Once it triggers once, it continues to work correctly throughout the session in any place in the file. So, this is only a one time ‘setup’ per session (until you can figure out the cause and fix it… :) )

I actually think that you are describing a expected behavior, let me explain :

First thing to know is that there is an option that automatically hides the autocompletion if the text you type results in no matches in the list. This is enabled by default. (Plus, if there is absolutely nothing to suggest, e.i. you have no language selected and the text is empty, the list won’t automatically show up)

Open fresh npp -> ok

Place cursor on a line that doesn’t have text -> at this point, you are probably on a new file, not associated with a particular language and the text is empty -> hence the list is empty

Start typing - auto-complete does not trigger -> since the list is empty, nothing happens when you type text (because of the option mentionned earlier) -> however you should be able to press CTRL+SPACE to show the empty list

Now place cursor on a line with text -> I guess you changed file or added text -> now the list isn’t empty

@jcaillon - Thanks for the response
That default behavior is perfect!
However, I don’t think I explained myself well enough:

No, I was in a file with over 1500 lines of text, I had just placed my cursor on an empty line.
And the file is associated with a UDL (by the way, when the autocomplete does trigger, it shows function params as well - nice!)

I just tried again, list was empty (even though I was in large file) and ctrl+space opened a HUGE list of words (I guess all the words in the file)

No, I just moved it up to the previous line that already had text

Actually, now I received different behavior. There are a bunch of steps:

Open fresh npp

Place cursor on blank line - no autocomplete

Place cursor on line with text - no autocomplete

Place cursor on line right after text - autocomplete triggers!

Press enter, now no autocomplete anywhere

Open new file in npp and return to previous file - autocomplete everywhere and anywhere!

@jcaillon - after reading that you couldn’t reproduce it, I realized that it must be something on my end…
I started debugging - I must have spent 2 hours debugging!This is my testing outcome:
[Excuse me for writing all these steps… it’s just that after debugging for so long… I just have to write what I did! :) ]

Created a new portable npp and installed your plugin - everything worked.

Installed all my plugins, everything worked!??

Removed all plugins from my original install - it worked!

Began putting all back few by few… I found that it was the python plugin!

but that’s odd, because in my new portable npp, I also had python plugin installed and it worked!?

I went back to my new portable install, removed all plugins except python. It worked!??

If so, it must be something with my Python plugin in my installed version.

I checked it and it was up to date.

Maybe it’s one of my python scripts? (read on…)

I copied all my Python scripts from my install into my new portable npp - it still worked!!

I started going through the config folder file by file…

Anyway, to make a long story short… the bug is due to a setting on Python script!
When Python script is set to start startup scripts ATSTARTUP (instead of LAZY), we get this funny behavior.

Steps to Reproduce: (You don’t have to follow these steps exactly, just have python plugin installed and set that setting to ATSTARTUP. I am just writing it this way to show that it is a pure conflict - not tied to anything on my machine.)

Fresh install of npp

Fresh install of Python plugin

Go to Plugins>Python Script>Configuration, and set Initialisation to ATSTARTUP

Close npp, reopen, the bug appears.

The minute you change file and come back, it begins to work.

However, I did realize that it doesnt behave this way with all files! I tried a python script, it worked fine. I tried a regular txt file, it worked fine. I has to do something with the text in my file.
For testing purposes, I was able to reproduce this issue with a file of just a few lines.

In order to help you find the problem, I am sending you the sample document. I am actually sending you 2 of the same docs with a slightly different name so you can see that immediately after moving to a new file, it begins to work even though the files are identical!
If it’s more convenient for you, I also packaged the entire portable npp folder. If you go with this, everything will be setup already (files included, and they will open immediately because of the sesssion file).Set of 2 files for testingNpp portable - all included

By the way, I tested this exact method on 2 different machines and got the same results.

I’m glad we found the source, I am assuming that the python plugin modifies some scintilla options on startup; I’ll investigate ASAP. In the meantime, an easy workaround is to switch documents on startup :p

I should be able to fix the DPI awareness for the next release; at least for the auto completion form (I have more complex issues in the main window).

@jcaillon, Ok, thanks!
The workaround is definitely ok for me… :)
Regarding the dpi issue, that sounds great for me! Thanks
After you release that I will hopefully be able use it and to provide much better feedback on the actual plugin.