Notepad++ whitespace autocomplete define
-
Is there a way to add white space to startFunc= for show of the function detail?
<AutoComplete> <Environment ignoreCase="yes" startFunc=" " stopFunc=" " paramSeparator=" " terminal=";" additionalWordChar = ":"/> <KeyWord name="abs" func="yes"> <Overload retVal="int" descr="descr"> <Param name="<param1>" /> <Param name="<param2>" /> </Overload> </KeyWord> </AutoComplete>
-
@Moutaz-Bakier asked,
Is there a way to add white space to startFunc
Sorry, no. As it says in the docs,
NOTE: Spaces can’t be used as the character for the attributes.
-
Is there a possibility to support the white space in the future?
-
The possibility increases from 0 after a feature request; but please understand that not all feature requests – even if they sound good to you – are accepted/implemented.
-
Are there other solutions to this problem or how to show hints?
-
So, if I understand your requirements, you have a language that doesn’t use parenthesis around the argument list and doesn’t use commas between arguments. Is this correct?
If so, I think you’re out-of-luck with builtin solutions. You would have to do a lot of coding, or find someone to do it for you, to make a custom plugin, or figure out all the scintilla commands to implement additional auto-complete syntax.
However, there’s a pseudo-workaround. If you have a snippets plugin of some sort (like QuickText), you could set up a snippet with the shortcut that gives the parameter names, for example, define
abs
with replacementabs param1 param2
. You would then manually have to go replace those placeholder params with your actual values… but it would at least remind you of what’s needed. (QuickText has multiple hotspots , which might allow you to easily go to the beginning or end of each param – but I’ve never figured out how to make it go to a second hotspot if multiple are defined; maybe @Michael-Vincent, who did the 64bit conversion, would be able to answer how to got to a second hotspot) -
@PeterJones said in Notepad++ whitespace autocomplete define:
but I’ve never figured out how to make it go to a second hotspot if multiple are defined
That should work, but I’ve only tested with my setup of the “Tab” key as the “Replace Tag” hotkey.
I’ll use Perl as an example (for many reasons :-). In my QuickText.ini tag file:
for=for my $$ ( $ ) {\n $\n}\n$
So in Perl when I type:
for[tab]
Where [tab] is me hitting the “Tab” key which is my hotkey for QuickText=>Replace Tag, I get:
for my $| ( ) { }
where the pipe “|” above is showing my cursor. Pressing “Tab” again moves my cursor to between the parenthesis:
for my $ ( | ) { }
again tab moves to the next line:
for my $ ( ) { | }
and on and on to all the “$” in the original tag. They mark the places where to stop.
Does that work for you, or does it not behave that way?
Cheers.
-
@Michael-Vincent said in Notepad++ whitespace autocomplete define:
Does that work for you, or does it not behave that way?
As ashamed as I am to admit it, it never occurred to me to use the same key sequence to move between hotspots as to start the QuickText replacement. DOH! Yes, the shortcut key sequence does loop through all the hotspots. (In my defense, the keysequence I was using wasn’t as simple as TAB, so I never accidentally hit it while in a hotspot location. And the README doesn’t mention that. :-) )
----
So, @Moutaz-Bakier , if you set the hotkey to TAB (and now that Michael’s pointed it out, that’s probably what I’d recommend, since it doesn’t get in the way of normal tab usage in NPP), then you should be able to set up QuickText. If you have your special filetype associated with a User Defined Language (UDL), then in QuickText, you could open up Plugins > QuickText > Options; it should select
USER
for you (unfortunately, there’s only one USER category shared among all UDL), and you can define all your functions as- abs =
abs $NamedArgOne $NamedArgTwo
- open =
open $FileName as $FileMode
- for =
for $var in $start thru $end
- superlongname =
superlongname with $namedArg doing $codehere
if you type
open[TAB]
, then it will fill inopen |FileName as FileMode
, putting your cursor before theFileName
argument, which you can then replace; then[TAB]
again will move toFileMode
.If
superlongname
is already in yourautoCompletion\myUdlName.xml
definition, then you should be able to use normal autocomplete feature to help you typesup[CompletionKey][QuickTextKey]
to get the long function name, then the hints.It’s not exactly what you want (popover hints), but it’s the least amount of programming to get something close. Maybe that will at least somewhat work for you.
- abs =
-
@PeterJones said in Notepad++ whitespace autocomplete define:
QuickText
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. -
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