• Login
Community
  • Login

Auto-Completion Is this Legal?

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
35 Posts 3 Posters 9.6k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L
    Lycan Thrope @Lycan Thrope
    last edited by Dec 18, 2021, 10:51 PM

    @lycan-thrope
    Love it when stuff doesn’t show, replaced it with this string  , to replace the spacing.

    Lee

    L 1 Reply Last reply Dec 19, 2021, 8:06 AM Reply Quote 0
    • L
      Lycan Thrope @Lycan Thrope
      last edited by Dec 19, 2021, 8:06 AM

      @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

      L 1 Reply Last reply Dec 19, 2021, 8:39 AM Reply Quote 0
      • L
        Lycan Thrope @Lycan Thrope
        last edited by Dec 19, 2021, 8:39 AM

        @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

        1 Reply Last reply Reply Quote 1
        • G
          guy038
          last edited by guy038 Dec 19, 2021, 8:05 PM Dec 19, 2021, 8:03 PM

          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 the Create New... command, I defined a new language called DBasePlus

          • 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 the Language menu, under User Defined Language


          Now, note that, in your DBasePlus.xml file, I preferred to change the ignoreCase attribute to no ( instead of yes )

          Indeed, it’s the only way to distinguish, for instance, between the commands #define and DEFINE !


          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 give 1 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

          L 1 Reply Last reply Dec 20, 2021, 9:03 AM Reply Quote 1
          • L
            Lycan Thrope @guy038
            last edited by Dec 20, 2021, 9:03 AM

            @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

            L 1 Reply Last reply Dec 21, 2021, 12:04 AM Reply Quote 2
            • L
              Lycan Thrope @Lycan Thrope
              last edited by Dec 21, 2021, 12:04 AM

              @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:
              autodialogwordserror.PNG

              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:
              autodialogwordserror2.PNG

              Mind you, this is with my current working list, but with only the Words selected in the Dialog. ::puzzled::.

              Lee

              P 1 Reply Last reply Dec 21, 2021, 12:56 AM Reply Quote 0
              • P
                PeterJones @Lycan Thrope
                last edited by Dec 21, 2021, 12:56 AM

                @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

                L 1 Reply Last reply Dec 21, 2021, 5:47 AM Reply Quote 0
                • L
                  Lycan Thrope @PeterJones
                  last edited by Dec 21, 2021, 5:47 AM

                  @peterjones ,

                  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&#xa0;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

                  L 1 Reply Last reply Dec 21, 2021, 6:05 AM Reply Quote 0
                  • L
                    Lycan Thrope @Lycan Thrope
                    last edited by Dec 21, 2021, 6:05 AM

                    @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

                    L 1 Reply Last reply Dec 21, 2021, 7:37 AM Reply Quote 1
                    • L
                      Lycan Thrope @Lycan Thrope
                      last edited by Dec 21, 2021, 7:37 AM

                      @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

                      P 2 Replies Last reply Dec 21, 2021, 2:18 PM Reply Quote 1
                      • P
                        PeterJones @Lycan Thrope
                        last edited by Dec 21, 2021, 2:18 PM

                        @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.

                        0189cfd0-07e9-4fdb-adc9-6a90ff22cd4b-image.png
                        – from Settings > Preferences > Auto-Completion

                        That 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 and checkbox_group are defined as keyword names in the auto-completion file perl.xml, and I have the word check already typed in my document.

                        radio box completion popup
                        ⦿ Function completion c875626f-e986-44fe-aac0-d3f06ee91cc7-image.png
                        ⦿ Word completion 6cc29660-ad25-4f4f-a1ec-095b38455f7a-image.png
                        ⦿ Function and word completion c53cbec7-9eb3-40e8-8ef1-48195d81a6b8-image.png

                        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.

                        P 1 Reply Last reply Jan 4, 2022, 7:46 PM Reply Quote 3
                        • P
                          PeterJones @Lycan Thrope
                          last edited by Dec 21, 2021, 2:34 PM

                          @lycan-thrope

                          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…

                          4e879dc2-4c42-4f5f-aae3-8b4788a8fab1-image.png

                          54a47228-5f93-4de5-8a74-7f7cd2423103-image.png

                          However, I’ll still clarify that in the Auto-Completion Preferences description as well.

                          P 1 Reply Last reply Dec 21, 2021, 3:07 PM Reply Quote 3
                          • P
                            PeterJones @PeterJones
                            last edited by Dec 21, 2021, 3:07 PM

                            @Lycan-Thrope ,

                            Does this make more sense in the Auto-Completion Preferences section?

                            c4624a5d-3d30-4a1b-9076-db3c1b203e79-image.png

                            L 1 Reply Last reply Dec 21, 2021, 6:42 PM Reply Quote 3
                            • L
                              Lycan Thrope @PeterJones
                              last edited by Dec 21, 2021, 6:42 PM

                              @peterjones ,

                              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

                              P 1 Reply Last reply Dec 21, 2021, 6:59 PM Reply Quote 0
                              • P
                                PeterJones @Lycan Thrope
                                last edited by PeterJones Dec 21, 2021, 7:00 PM Dec 21, 2021, 6:59 PM

                                @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.

                                L 1 Reply Last reply Dec 21, 2021, 7:09 PM Reply Quote 3
                                • L
                                  Lycan Thrope @PeterJones
                                  last edited by Dec 21, 2021, 7:09 PM

                                  @peterjones ,

                                  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

                                  1 Reply Last reply Reply Quote 2
                                  • P
                                    PeterJones @PeterJones
                                    last edited by Jan 4, 2022, 7:46 PM

                                    @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.

                                    L 1 Reply Last reply Jan 4, 2022, 9:01 PM Reply Quote 4
                                    • L
                                      Lycan Thrope @PeterJones
                                      last edited by Jan 4, 2022, 9:01 PM

                                      @peterjones ,

                                      Thanks, “crystal clear”. :)

                                      Lee

                                      L 1 Reply Last reply Jan 6, 2022, 7:30 PM Reply Quote 0
                                      • L
                                        Lycan Thrope @Lycan Thrope
                                        last edited by Jan 6, 2022, 7:30 PM

                                        @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

                                        P 1 Reply Last reply Jan 6, 2022, 8:03 PM Reply Quote 0
                                        • P
                                          PeterJones @Lycan Thrope
                                          last edited by Jan 6, 2022, 8:03 PM

                                          @lycan-thrope ,

                                          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.

                                          L 1 Reply Last reply Jan 6, 2022, 8:14 PM Reply Quote 1
                                          • First post
                                            Last post
                                          The Community of users of the Notepad++ text editor.
                                          Powered by NodeBB | Contributors