Auto-Completion Is this Legal?
-
@lycan-thrope
Love it when stuff doesn’t show, replaced it with this string 
, to replace the spacing.Lee
-
@lycan-thrope
Wow…now to compound problems, after trying removing all the duplicates and special characters, I decided to reload my test file…and guess what. It doesn’t work now. Sheesh…this is just not my day. Taking a few off…I’m done for now.Thanks for any suggestions in my absence…unless I get another epiphany about what’s wrong. :(
Lee
-
@lycan-thrope
AARGGGHHHH
Beating self about the face and head furiously, again. :(I had my epiphany, as soon as I gave up and took the pressure off…something clicked. It was a typo.
Apparently, my mass formatting that I assumed was done on the bulk list of keywords and functions was woefully SHORT of the last keyword, so it had no
"/>
at the end of the very last keyword in my lists that I was cutting and pasting. Don’t ask me why the example above shows it, but in exhaustion I looked at the file one more time and saw it.Now, my large function file still is not showing up properly, ( and I did check the last keyword), at least my stripped out keyword only list, which is quite large also, works now.
Now to find out why the function hints of the large file aren’t working.
Thanks for the eyes even if they were averted. :)
Lee
-
Hello, @lycan-thrope,
May be, I’m totally off-topic but :
-
I used your second
AutoComplete
version, defined here -
In Notepad++, I entered, near the bottom of the
Language
menu,User Defined language > Define your language...
, and, with theCreate New...
command, I defined a new language calledDBasePlus
-
I did not add anything else and just closed the window
User Defined Language v.2.1.0.12
-
I opened a classical new tab
-
And I selected the
DBasePlus
language, at the bottom of theLanguage
menu, underUser Defined Language
Now, note that, in your
DBasePlus.xml
file, I preferred to change theignoreCase
attribute tono
( instead ofyes
)Indeed, it’s the only way to distinguish, for instance, between the commands
#define
andDEFINE
!
I, then, tried a lot of keywords, like
ABS
,CLEAR ALL
,ZAP
and even__version__
and all of them got displayed for validation, without any problem !In case of keywords with the
\xA0
character, once the correct expression is validated, the search of\xA0
do give1
match !
So, I’m rather confused about all your troubles that you described and also about your very last keyword which should be wrong ?
Best Regards,
guy038
-
-
@guy038 ,
Thanks for the check. In the code you asked about, I mentioned I can’t explain how the text I uploaded here had the last keyword properly closed, but in the one I had been using live, it was unclosed.
Like this:<KeyWord name="__version__ </AutoComplete> </NotepadPlus>
Notice that
__version__
is missing"/>
That was the problem I posted above having found. Apparently, I must have fixed it when uploading, thinking I had just then cut it short, but it was indeed missing those closing characters, because I was pasting in between the start of the keywords below the Environment section and the closing AutoComplete tag.
The Function list is working now…as I found a second typo, probably due, again, to cutting and pasting. Apparently I had a double
<<
set on an opening tag for a keyword/function set of tags.It’s all good. I’m human, I’m humble and can admit my shortcomings. :-)
If was just weird that I thought I had done everything correctly in the production file I had cut and pasted into the autocompletion file, when I hadn’t and found the errors late into the night/morning while I was in the midst of preparing to commit Hari Kari, when I decided to take one last look at the errant code and found it. (Whew…) :-)
I should have know, that I was meticulous on my test file, that’s why it worked, but my production file where I was mass formatting and then cutting and pasting function skeletons in to fill with the information that I must have screwed up something. I knew it probably was my fault, but I had to ask if I had hit some kind of wall I wasn’t aware of because of the large sizes of my auto completion function hint sections as compared to the other autocompetion files…because I thought I had done everything right. :(
Lee
-
@lycan-thrope
Folks,There is one thing that puzzled me while I was trying to troubleshoot the problems I was having, and that is that I turned off the both keywords and functions completion option in the autocompletion dialog, and selected only the Word Completion as the screenshot shows:
But apparently, selecting that option, stopped anything from working as one of the reasons that my keywords didn’t show was that I had changed the settings for the dialog to words only. When in desperation, I selected again, the Words and Functions, the keywords again were able to be completed. This screenshot shows that after typing many letters I still did not have a selection dialog:
Mind you, this is with my current working list, but with only the Words selected in the Dialog. ::puzzled::.
Lee
-
@lycan-thrope said in Auto-Completion Is this Legal?:
puzzled
Why puzzled? Word-only completion is completion hints based on other words in your active file. Function-only completion is completion based on FunctionList. Function+Word gives you both. Your experiment agrees with that, unless I have misread something
-
Maybe I’m misreading something again? The words, in this partiular example, that I was typing was “ALTER TABLE”, one of the keywords in my autocompletion file.
<KeyWord name="ALTER TABLE"/>
So unless the dialog box means “Words” that are present in the document you are typing, then, yes, I have obviously misread it. If it means words, that are keywords in the autocompletion file (not the functions that still worked once the open parens was typed), then I’m not misreading. If it means Words, as in keywords in the UDL ‘keywords’ dialog, then there is a gross misunderstanding on my part about the Autocompletion files purpose and the Preferences Autocompletion settings purpose.
Is my interpretation a misreading? I figured the Autocompletion dialog was allowing Keywords only, in the Autocompletion file, to be autocompleted, rather than the Keyword Functions in that same file.
As an aside, I don’t remember if I asked this question before about the UDL and keywords (because I could try and put it here instead) in the below code file, the Main Class declaration I want stylized, not the function property.
class PlainObjectListForm of FORM with (this) onOpen = class::FORM_ONOPEN onClose = class::FORM_ONCLOSE doubleBuffered = true metric = 6 // Pixels colorNormal = "Gray" height = 529.0 left = 110.0 top = 29.0 width = 1092.0 sizeable = false pageno = 0 refreshAlways = false endwith
I tried putting class in the folding code 2 styler that required their to be spaces around the word for it to be recognized as a proper to highlight word, which the object resolution operator
::
(double colon) would disqualify it from being highlighted. I’ve tried a bunch of different places for it to be in the different UDL dialogs and couldn’t get it to not highlight the function property word.Thanks for any guidance on these subjects in advance,
Lee
-
@lycan-thrope
I figured out, how to stop that behavior with the scope resolution operator. I had to pull the singular:
colon out of the operators 1 dialog.
::smacking head::Of course, now I just need to be set straight on my understanding of the dialog’s choice purposes. :-)
Lee
-
@lycan-thrope
Peter, please disregard my misunderstanding. Based on your explanation, I went back and clicked only the Functions option in the Autocompletion dialog and found that indeed, that setting allowed by keywords and keyword Functions to list properly. I guess having US English as my native language is a detriment for me in understanding how some of the documentation is written. :) Thanks for the explanation that brought enlightenent.Lee
-
@lycan-thrope said in Auto-Completion Is this Legal?:
I guess having US English as my native language is a detriment for me in understanding how some of the documentation is written.
– from Settings > Preferences > Auto-CompletionThat seems pretty standard US English to [me](“Admittedly, my interpretation is biased”). But there is some ambiguity… probably because at the time that I wrote that about three years ago, I hadn’t ever actually done any of the customization of auto-completion, and I hadn’t experimented as fully with what those settings do.
Let’s compare what the three settings show when Perl is the active language, where
checkbox
andcheckbox_group
are defined as keyword names in the auto-completion file perl.xml, and I have the wordcheck
already typed in my document.radio box completion popup ⦿ Function completion
⦿ Word completion
⦿ Function and word completion
I will add it to my TODO list to clarify the description in the usermanual to make it more clear what “word” vs “function” is.
-
https://npp-user-manual.org/docs/auto-completion/
The first paragraphs of the “Function completion” and “Word completion” sections of the main Auto-Completion page does clarify the differences…
However, I’ll still clarify that in the Auto-Completion Preferences description as well.
-
Does this make more sense in the Auto-Completion Preferences section?
-
Thanks, that is much clearer.
I apologize if you took my joke about English as a chide, it was actually an attempt at self-deprication.
I think the problem I was having is that the entire section of AutoCompletion explanation is encompassing many areas. The modifications, the dialog, the syntax, and it kind of got confusing for me, as I tend to be a meticulous reader having copy editing as a past practice. You wouldn’t know it from my typos, but that has more to do with fat fingers and little keys. :)
My assumption, was that the Autocomletion section was devoted to the modification aspect, and that misinterpretation is on me. I appreciate your time and patience with my learning your systems. One of the reasons you may see so many questions has to do with my communication background in that the only stupid question is the one not asked. Of that, I’m guilty as hell as I always try to strive to understand exactly what is said or written, versus what I thought was said or written. Now, if only I could get my wife to understand that, we’d have less disagreements. :-)
Thanks again, and I’m glad that with your help, I’m finding my way through this stuff to be able to get something useful out of the efforts for the my community as well as yours, those that know and use dBASE are fans of the editor, so it stands to reason someone should have taken the time to get this together.
I do have one question, on the tip of my to-ask list, and that is:
Are the languages listed in the Preferences dialog box compiled into the program, .dll files, or are UDL’s able to get listed in and used in the Preferences for setting the options of the Languages? It would be safer than letting the users modify the language via the “Define your language” dialog, so as not to mess things up. :-)
Lee
-
@lycan-thrope said in Auto-Completion Is this Legal?:
that is much clearer.
Thanks. Then I will submit my PR, and those changes will be in the next release of the usermanual, whenever that ends up being.
Are the languages listed in the Preferences dialog box compiled into the program, .dll files, or are UDL’s able to get listed in and used in the Preferences for setting the options of the Languages?
Only the compiled-in languages show up in the Preferences > Style Configurator box, with the UDL kept as separate as possible while still being usable. That was a design decision made a decade or more ago, and is part-and-parcel of the name “Notepad++” at this point.
It would be safer than letting the users modify the language via the “Define your language” dialog, so as not to mess things up. :-)
I disagree. The point of UDL is so that the User can Define things – it’s two thirds of the name of the feature, after all. That’s what Notepad++ prides itself on: being able to be configured and customized by the user.
-
Thanks for the change.
Thanks for the clarification of the Preferences inclusion. I suspected as much, but thought I better verify that.
I agree with most of your point about the User defining, the problem is that if it was so easy for them to make one, they wouldn’t have been asking if there was one, and would have made it. After what you and I have been going through, I’d like to bullet-proof it so I’m not being asked “How do I undo what I did?” questions. :-)
Thanks again, and Merry Christmas and Happy New Year if I don’t get back in here as I’m trying to madly finish the grunt work on the functions to get it done for the Holidays. :-)
Lee
-
@peterjones said in Auto-Completion Is this Legal?:
I will add it to my TODO list to clarify the description in the usermanual to make it more clear what “word” vs “function” is.
The updated User Manual has been released, and now https://npp-user-manual.org/docs/preferences/#auto-completion does a better job of clarifying “word” vs “function” in those preferences.
-
-
@lycan-thrope
Peter, et al,According to the documentation:
For any given function, all text, plus 2 bytes per parameter, plus 24 bytes if 2 overloads or more, can’t spill over 2,043 bytes. Remember that a byte is a byte, so formatting whitespace competes with actual text.
I should be limited to that size for an entire function with overloads. However, prior to trimming it for size per the recommentations, I was functional with a size of well over 2200 characters. This happened because I changed the hard code<>
characters to the escaped versions, thereby increasing each angle brackets character count from 1 to at least 4 characters per angle bracket, unless the escaped characters aren’t counted going into the parser.Is that the case? A couple of large functions I had checked while doing the building of the hints for functions, so I know when I did it, it was within those character(byte) counts. While compiling the different modules into the final file I noticed it looked a bit larger, and checked the size via a character count website…where it reported that, the working in NPP function size was more than the limit.
Has the size been increased, or does the parser just not count the extra characters needed to escape the angle brackets?
Lee
-
That’s getting deep into implementation details. If the 2200 character version worked for you, it is likely that the &-entities are converted to real characters before the byte-limit is hit, but I cannot guarantee it.
Someone who is pushing up against that limit would be well-advised to be wary, and see if there is any way to trim down the text – and maybe even seek out the source code for that portion, and see what order events occur, and exactly when the character limit is hit.