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.
    • Lycan ThropeL
      Lycan Thrope @Lycan Thrope
      last edited by

      @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

      PeterJonesP 1 Reply Last reply Reply Quote 0
      • PeterJonesP
        PeterJones @Lycan Thrope
        last edited by

        @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

        Lycan ThropeL 1 Reply Last reply Reply Quote 0
        • Lycan ThropeL
          Lycan Thrope @PeterJones
          last edited by

          @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

          Lycan ThropeL 1 Reply Last reply Reply Quote 0
          • Lycan ThropeL
            Lycan Thrope @Lycan Thrope
            last edited by

            @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 ThropeL 1 Reply Last reply Reply Quote 1
            • Lycan ThropeL
              Lycan Thrope @Lycan Thrope
              last edited by

              @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

              PeterJonesP 2 Replies Last reply Reply Quote 1
              • PeterJonesP
                PeterJones @Lycan Thrope
                last edited by

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

                PeterJonesP 1 Reply Last reply Reply Quote 3
                • PeterJonesP
                  PeterJones @Lycan Thrope
                  last edited by

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

                  PeterJonesP 1 Reply Last reply Reply Quote 3
                  • PeterJonesP
                    PeterJones @PeterJones
                    last edited by

                    @Lycan-Thrope ,

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

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

                    Lycan ThropeL 1 Reply Last reply Reply Quote 3
                    • Lycan ThropeL
                      Lycan Thrope @PeterJones
                      last edited by

                      @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

                      PeterJonesP 1 Reply Last reply Reply Quote 0
                      • PeterJonesP
                        PeterJones @Lycan Thrope
                        last edited by PeterJones

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

                        Lycan ThropeL 1 Reply Last reply Reply Quote 3
                        • Lycan ThropeL
                          Lycan Thrope @PeterJones
                          last edited by

                          @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
                          • PeterJonesP
                            PeterJones @PeterJones
                            last edited by

                            @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 ThropeL 1 Reply Last reply Reply Quote 4
                            • Lycan ThropeL
                              Lycan Thrope @PeterJones
                              last edited by

                              @peterjones ,

                              Thanks, “crystal clear”. :)

                              Lee

                              Lycan ThropeL 1 Reply Last reply Reply Quote 0
                              • Lycan ThropeL
                                Lycan Thrope @Lycan Thrope
                                last edited by

                                @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

                                PeterJonesP 1 Reply Last reply Reply Quote 0
                                • PeterJonesP
                                  PeterJones @Lycan Thrope
                                  last edited by

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

                                  Lycan ThropeL 1 Reply Last reply Reply Quote 1
                                  • Lycan ThropeL
                                    Lycan Thrope @PeterJones
                                    last edited by Lycan Thrope

                                    @peterjones said in Auto-Completion Is this Legal?:

                                    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.

                                    Okay, this make sense in hindsight, but as your next point makes…

                                    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.

                                    I was testing it, that’s how I knew I was within limits before I did the conversion to escaped characters, per your recommendation. I did it, even though it worked, on the off-chance that future parsers change their behavior with regards letting that character survive in quotes, and hence the increased size is what caught my attention. The stock dBASE syntax notation use of angle brackets Indicates an argument that you must supplymeaning, there were a lot of them in those multiple overload, parameter and entries.

                                    Thanks for what insight you could provide.

                                    Lee

                                    Lycan ThropeL 1 Reply Last reply Reply Quote 0
                                    • Lycan ThropeL
                                      Lycan Thrope @Lycan Thrope
                                      last edited by

                                      @lycan-thrope
                                      As a note, if anyone else has need for it, I used this character count website to check it out, so it was open in the tab next to the NPP documentation while writing them so I could check the count supplied against the count I could have. : -)

                                      Lee

                                      PeterJonesP 1 Reply Last reply Reply Quote 0
                                      • PeterJonesP
                                        PeterJones @Lycan Thrope
                                        last edited by

                                        @lycan-thrope said in Auto-Completion Is this Legal?:

                                        I used this character count website to check it out,

                                        Any reason you didn’t just use Notepad++ status bar? It shows the size of any single-region selection:
                                        58dd85e2-bc75-496b-96b0-315e73a5c76c-image.png

                                        And if you were trying to get the data on multiple text entries in the same function, you would have had to copy them from their attribute locations into the website, so why not just copy them into a new tab in Notepad++? (And a new tab makes it even easier, since it already gives the length of the whole tab.)

                                        Lycan ThropeL 1 Reply Last reply Reply Quote 2
                                        • Lycan ThropeL
                                          Lycan Thrope @PeterJones
                                          last edited by

                                          @peterjones ,

                                          Umm…because I didn’t know it did that? :-) I knew about the character count in the file, but had never noticed the ‘sel’ part…doh! Aside from that, I still had the manual open and could check when it gave me the count, since I don’t remember everything, I could check the manual. :-)

                                          Thanks, btw.

                                          Lee

                                          Lycan ThropeL 1 Reply Last reply Reply Quote 0
                                          • Lycan ThropeL
                                            Lycan Thrope @Lycan Thrope
                                            last edited by Lycan Thrope

                                            @lycan-thrope
                                            Incidentally, this is normally what I see, but I see now when I’ve selected something, it comes up. ::sigh:: so many options, not enough reading. :-)

                                            ACStatusBar.PNG

                                            Lee

                                            Lycan ThropeL 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post
                                            The Community of users of the Notepad++ text editor.
                                            Powered by NodeBB | Contributors