Notepad++ whitespace autocomplete define
-
The QuickText did not show the names of the languages, nor did it follow what I wanted.
I would like to show information about the statement after writing it then a space.I am sorry it was not sufficient for you. You don’t say what about my workaround (which was very clearly described as only a partial, “close” workaround, not as exactly what you wanted) wasn’t good enough for you. And unless you can articulate that better, I doubt any workaround or feature implementation will meet your needs.
Like I said earlier, I am unaware of any way to make the parameter-list autocomplete work the way you have described, as the application is currently written. The only alternative is a lot of programming on somebody’s part – whether it be in a plugin, using a PythonScript, or changing the codebase of the Notepad++ application itself.
Writing a plugin, or changing the codebase, aren’t something we can do for you in this forum. Writing a simple PythonScript solution to a user problem has often been done in the forum, but I think your request is more complex than could be reasonably expected someone in a forum-situation to deliver.
If you want to make a feature request, follow this faq – which I already linked above. But I am betting it’s not likely to be accepted/implemented, or, if it is, it will be months or longer down the road before you would see it released. If you do go down this route, you need to be very clear in your description of the feature (because given your brief description and terse replies and lack of detail, I find it very unlikely that anybody’s implementation of the feature would match what you wanted, even if someone were trying to put in the effort of implementing it).
-
Is there a similar QuickText plugin?
-
Is there a similar QuickText plugin?
There are other code-snippet plugins. None of them will do exactly what you want, because that is not their intention. I was just using QuickText as an example snippet plugin which I happened to know well enough to come up with a possible workaround to the features that I thought you were wanting.
But you seem unwilling to share how my QuickText suggestion wasn’t close enough. It might be that QuickText can get a little closer – or it might be that another snippet plugin will come closer. But none of them do exactly what you want. The feature that you have asked for, as far as I know, has never been implemented for Notepad++. And since you won’t tell us how close is “close enough”, without it being the exact feature that you want, then there is no way for us to guess how to make QuickText or any other plugin work “well enough” for you, since you haven’t defined that to us.
As your continued posts have added nothing to my understanding of what you want, I will not be replying again to you until you are willing or able to provide enough detail that I have something more to add. As none of the other 46 views of this page (as of right now) have chimed in about your core issue, my guess is that no one else has been able to come up with anything more to add. If you want help, you’re going to have to provide more details. Sorry.
-
Thanks for the help
-
So npp does not support languages like VB where subs can and in some ways should be called without parentheses? Some weird limitations.
-
@rinzwind5 said in Notepad++ whitespace autocomplete define:
So npp does not support languages like VB where subs can and in some ways should be called without parentheses? Some weird limitations.
“Weird”, no. It would be nice to have, but that’s not a “weird” limitation, just a limitation.
The library that Notepad++ uses for the syntax highlighting takes care of the per-language rules for syntax highlighting, which allows Notepad++ developers to focus on the core of the application rather than having to make the developers know 90+ languages fluently enough to program those edge cases; but, while Notpead++ makes use of that libraries facilities for doing the auto-completion popups, that library unfortunately does not have all the rules for functions and parameters lists coded to give Notepad++ the ability to hook into those rules – which means it is up to the Notepad++ developers to figure out all those rules.
Years ago, the developers figured out the system that is now the auto-completion feature of Notepad++, which gave a reasonable subset of the abilities, but I’m not sure there’s been much activity in terms of adding new features – I don’t know if, for example, anyone has ever put in an official feature request to support something like
startFunc=" "
. If someone did, especially pointing to a discussion like this that people have been wanting it for at least half a decade, it might at least let the developer know that it’s something that’s wanted. (As the FAQ suggests, however, make sure to search both open and already-closed requests, to see whether it’s an open suggestion, or whether the developer already rejected it for some reason.) But unless and until someone requests it, it’s never going to be added, however weird you think the lack of that feature is.In the mean time, QuickText plugin does give a reasonable alternative for making templates to quickly enter common functions and there parameters, even with spaces, as shown by my post from 2020
-
This is the line in the Notepad++ source that disallows a space as being recognized to start the calltip :
Space, Tab, Carriage Return and Line Feed are set to do nothing.
Remove the part
ch == ' ' ||
from that line and the calltip displays.Not stating changing that part of the code would be enough as a permanent fix as the other calltip code may check for these characters as well.
-
It is a needless limitation. One can’t create a autocomplete file for one of the first programming languages a lot of people grew up with. 80’s BASIC, like MSX Basic, BBC Basic. (still going on btw), or modern variants used for home brew. Or any (partial) command type language.
It would also make variable declaration or any statement completion easier. But that’s another step ok.
Also would be nice if custom language additions could be supplied to end user as one zip file and ‘imported’ into notepad++ instead of manually moving/editing files.
Manual is also confusing, because it does not tell you about the difference of build-in languages and the supposed advantages of UDL’s. Which the build-in do not use… so advantages? hmmm
-
from autocomplete manual: “Following is a list of <KeyWord> tags. They are either auto-closing, for keywords that are not routines, or not when they are. Each such tag has a mandatory name attribute, the keyword/routine name to recognise. The list must be sorted according to this attribute and the value of the <Environment> ignoreCase attribute. See subsections below for more on keyword names and sorting.”
Is this still true? If so it is very cumbersome and something a computer should do. Anyway, it seems to work too without sorting?
-
@rinzwind5 said in Notepad++ whitespace autocomplete define:
It is a needless limitation.
That depends on whether you mean “needless”, as in “I want it to not be that”, or you define needless as, “there is no technical reason why it could not be implemented as such”. Until you have made the code changes to N++ that you think would make that work, and proven that those code changes to make you happy would also not cause regressions for everyone else, you cannot be certain about whether it’s a “needless” restriction or a restriction that has consequences that are annoying to you but is needful for a deep and/or complicated technical reason. Much of the time, such design decisions on less-critical aspects are chosen by “what is practical and feasible” rather than “what would be preferred, if everything was as easy as we wish it was”.
I don’t disagree that it would be great if the function-parameter auto-completion worked in BASIC-style languages. But “what would be nice” isn’t always a strong enough reason to incur the technical-debt and time-debt to implement something that might not be as simple as it looks like on the outside. And if no one makes an official feature request (which you haven’t done yet, despite my suggestion to do that yesterday), then the developer is never going to see or consider your ideas, let alone decide whether or not it’s implemented. So no matter how cogent (or not) your arguments are, they won’t do any good here to convince the developer to agree with you, since he hasn’t seen your request yet.
Also would be nice if custom language additions could be supplied to end user as one zip file and ‘imported’ into notepad++ instead of manually moving/editing files.
Not as a zip, but Language > User Defined Language > Define Your Language > IMPORT does import the XML into the right location for you.
update: Sorry, I was thinking of just the UDL, ignoring the “autocomplete” context of this dicussion. You are right, there is no import action for autoCompletion definitions. However, for the UDL that have autoCompletion definitions in the UDL Collection, my new CollectionInterface plugin (available in the Plugins Admin starting with N++ v8.8.1) allows you to grab a UDL and its associated autoCompletion and/or FunctionList definitions, and install them in the right place for you, and even offer to restart Notepad++ so they’ll take effect.The original Notepad++ was highly customizable… but since the developer thought that the coders who were most likely to be using N++ in the early days were able to figure out things like where to put config files, such things weren’t originally given “pretty” interfaces. And either no one has asked, or the developer has never felt it worth his time, for him to go back and “pretty” such interfaces up, Since I was part of the push to get the UDL Collection, along with its backend checks and automation, I thought it would be good to create a plugin that gave an easier method to grab a UDL and its associated files, because modern users seem less happy with dealing with config files than early-2000s users were.
Manual is also confusing, because it does not tell you about the difference of build-in languages and the supposed advantages of UDL’s. Which the build-in do not use… so advantages? hmmm
Those two sentences make no sense to me. What difference do you think the manual is not telling you about? What do you think these “supposed advantages of UDL’s” are that are being kept secret from you?
(update: did you somehow read my post as saying “built in languages can do function-parameter autoCompletion with spaces, but UDLs cannot”? or vice versa? because I didn’t intend to say either: I was trying to say that none of the autoCompletion is done with that library, because that library doesn’t have any logic for deciding on autoCompletion [it just provides the interface to be able to pop up any messages that the application wants to pop up], so neither built-in languages nor UDLs get that feature.)
Is this still true? If so it is very cumbersome and something a computer should do. Anyway, it seems to work too without sorting?
It is best practice. If it works for you, and you don’t mind ignoring best practice, go ahead. But the UM recommends it for good reason – a few years ago, when I was spearheading the effort to get an up-to-date User Manual, one of the things we came across was that there were some complicated edge cases (no, I don’t remember the details; there might be discussion here about it, but I am not going to search for them right now) – I believe that the original wiki were were using as our starting point for the User Manual recommended it, and since our tests confirmed edge cases, we maintained that recommendation in the modern User Manual.
Whether or not it’s technically feasible for Notpead++ to do the sorting internally wasn’t something we were concerned about when documenting what is. If no one ever requested that feature, it’s not surprising that it has not been changed in the intervening years. If someone wanted to ask for the feature to be able to not manually sort the KeyWord tag list in the autoCompletion files, they would be within their rights to go create a Feature Request Issue at the GitHub repository, as described in the FAQ I already linked you to, and politely make that request (assuming they have searched to make sure it wasn’t already requested); but, if no one has asked for it, then it’s not surprising the developer has never added it. (Don’t get me wrong: I think it would be a better user experience if the users defining autoCompletion lists didn’t have to figure out how to sort those themselves, and it does seem like sorting is something that the Notepad++ app could do after reading the file; but again, I haven’t studied that section of the code, and cannot say whether there would be unforseen consequences.)