Issue with autocompletion - comparing 7.3.3 and 8.3
-
Good evening,
Debug info from 8.3:
Notepad++ v8.3 (64-bit)
Build time : Feb 3 2022 - 03:39:05
Path : C:\Users\Mateos\Desktop\N++ AutoCompletion Regression Test\npp.8.3.portable.x64\notepad++.exe
Command Line :
Admin mode : OFF
Local Conf mode : ON
Cloud Config : OFF
OS Name : Windows 10 Pro (64-bit)
OS Version : 2009
OS Build : 19042.1466
Current ANSI codepage : 1252
Plugins : mimeTools.dll NppConverter.dll NppExport.dllStarting from clean portable x64 installs freshly downloaded from the website
Modified the Autocompletion to begin starting from the 3rd char instead of 1st one
Added a UDL called ‘test’, and simply adding a test.xml file to plugins/APIs for 7.3.3 and autoCompletion for 8.3That test.xml is a copy of: https://subversion.assembla.com/svn/omnibot/Enemy-Territory/0.8/tools/Notepad++/autoCompletion/omni-bot.xml
The test is focusing on the keywords beginning by ‘tra’
7.3.3: typing ‘TRA’ will list TRACE.* entries, ‘Tra’ will list the Trace* ones (note: casing back then)
8.3: typing either ‘TRA’ or ‘Tra’ will only list TRACE* entries… (note: casing is correctly ignored as indicated at the top of the XML)Now, closing N++, then if you clear all the keywords in the XML but the ones starting by the letters ‘tra’ (ignoring the case, so you have from TRACE.ALL to TransformAndDrawLineList), it will work!
Can anyone try to reproduce, and if successful, just say so, and if someone can explain this to me ^^’ or am I missing something huge?
Regards
-
It appears that while the parsing of the autoCompletion XML file honors ignore-case when reading the file, the AutoCompletion box appears to be using lexical (case-sensitive) sort when displaying. You can see this in my screen-capture below, which shows if I scroll up from TraceLine, it eventually gets to the TRACE.*
To replicate your situation, I did a fresh v8.3 portable, downloaded the XML you linked to and saved it as autoCompletion\gamemonkey.xml (to match the language name inside the XML), then opened NPP and created a UDL called GameMonkey. When I set Language > GameMonkey and started typing, the video was my result. Other than the order of TRACE vs Trace, it all behaved as I would have expected. (Where I know that the
.
interferes with normal behavior, because.
is not a word character, and auto-complete does not always do what you want around non-word-characters.)(sorry for delayed response; I didn’t have a chance when I first read your post last night, and it fell off my radar until I was going through my mental scan of “recent posts with no reply”)
-
Your test appears to be invalid. The 10th frame of the gif shows that the autocomplete displays on the 1st character. Later, you backspace to the 2nd character to display the autocomplete. As Mateos81 instructs, set the autocomplete to display at the 3rd character. The autocomplete lists displayed in the gif are not the same lists that would display on the 3rd character.
Need to set
1
to3
in:Preferences -> Auto-Completion -> From
3
th characterelse you need to cancel autocomplete on the 2nd character and then type the 3rd character to display the autocomplete list for the 3rd character.
The autocomplete list for
T
can be different to the autocomplete list forTra
.Sorry about the nice gif, though the details for testing are important.
This is my test:
- Added omni-bot.xml into the locations.
- Using default settings for UDL named test.
- Set display autocomplete on 3rd character.
- Set test UDL as the language.
- Type
Tra
.
7.3.3 autocomplete displays:
TraceLine TransformAndDrawLineList
- If ignorecase=no followed in the UDL xml, it seems OK.
- If ignorecase=yes followed in the AutoComplete xml, it seems to Fail.
8.3 autocomplete displays:
TRACE.ALL TRACE.FLOODFILL TRACE.FLOODFILLENT TRACE.GRATE TRACE.OPAQUE TRACE.PLAYER TRACE.PLAYERCLIP TRACE.SHOT TRACE.SMOKEBOMB TRACE.SOLID TRACE.VISIBLE TRACE.WATER
8.3 should not display that list for either ignorecase=no or ignorecase=yes, in my opinion.
- If ignorecase=no and
TRA
was typed, then OK, thoughTra
was typed. - If ignorecase=yes, I would expect to see also
TraceLine
andTransformAndDrawLineList
in the list.
In my opinion, 8.3 has an issue with the autocomplete displayed on the 3rd character.
-
@mpheath
@Mateos81
@PeterJones7.3.3 to 8.3 is a WIDE number of versions and changes. I looked at the git blame of AutoComplete.cpp and there seems to be an interesting one about case.
That occurs between Notepad++ versions 7.9.5 and 8.0. Perhaps getting both of those versions and running your test.
If the commit I reference is indeed the culprit, I would expect:
- 7.9.5 functions as 7.3.3
- 8.0 functions as 8.3
And then we would have narrowed it down to versions and potentially the commit. Note, there may be other commits against UDL files and case that are affecting this as well, I must admit, I’m not fully grokking the issue and which set of settings is working / causing issues.
Cheers.
-
@Mateos81 , et alia,
Trying again with 3 character auto-complete, I’m coming closer to the described behavior in 8.3.
Unlike @mpheath , I couldn’t get auto-complete to work at all if the autoCompletion filename wasn’t gamemonkey.xml, and if the UDL name didn’t match the name inside gamemonkey.xml (ie, GameMonkey).
However, in v7.3.3, I still couldn’t get what I would consider “correct” behavior. In v7.3.3, whether ignoreCase was yes or no, the auto-complete seemed to pay attention to case, and showed me mutually-exclusive results for
TRA
vsTra
(and showed no auto-Completion fortra
).And v7.9.5 seemed somewhere in between in terms of behavior, so I think some of the other changes in v7.3.3-v7.9.5 affected this as well.
If you want to put in a bug report, you are allowed to do so. If you do, I highly recommend giving more examples, and a pared-down autoCompletion file that just has enough to replicate the problem, so it requires the least amount of effort on the part of the developers in order to replicate your problem (and so that there aren’t extraneous things getting in the way). When describing the problem, I would say that the expected behavior is:
If ignoreCase="yes"
, typingtra
orTra
orTRA
ortRa
should all get the autoCompletion to showTRACE.*
andTraceLine
andTransformAndDrawList
. IfignoreCase="no"
, typingtra
ortRa
should not show any autoCompletion;Tra
should show only the last two, andTRA
should show all of theTRACE.*
resultsHowever, before doing the bug report, I might try experimenting with an autoCompletion file that doesn’t contain any punctuation in the auto-complete terms; as I said earlier, punctuation (including a period/dot) can have strange effects on the matching algorithm, and that might be creating the problem.
-
@michael-vincent said in Issue with autocompletion - comparing 7.3.3 and 8.3:
I looked at the git blame of AutoComplete.cpp and there seems to be an interesting one about case.Thanks for the information of where to debug. Quite helpful.
I have submitted an issue report #11187 with a patch which may fix the autocomplete list. In my testing the fix, the autocomplete list looks much better.
-
Thank you everyone ^^
The .xml file name has to match the UDL name, but inside it the language field is purely descriptive (see https://npp-user-manual.org/docs/auto-completion/#auto-completion-file-format)
Next time I’ll try to be more verbose and explicit on my posts to be precise when it comes to reproduction steps
Really appreciate all you’ve done over the past days!