modify files names as desired
The default config is my config, which puts AHK v2 as the default, and is listed first. If you want AHK v1 to be the default, remove the #_ from the file name
go to the UDL ui:
Language > User Defined Language > Define your language...
select the version of AHK UDL you want to edit
input the extension data ONLY for the one you want to be the default for loading AHK files
if you are using the light theme, rename the following line (near the top of the file) to exclude (light)
This is particularly important if you plan to use Auto-Complete / Call Tips. I don't actually use the light theme, but I do put effort into maintaining it.
Auto-Complete and Call Tips
Notes:
only AHK v2.0.10 for now
I added all #directives, functions, built-in variables
#directives work with auto-complete with a few conditions:
1) I made a list of #directives starting with _ so you can pull up a list of directives by typing _
2) I also made a list of #directives ending with _ for easy Auto-Complete and identifying which terms are #directives. Of course, backspace the _ when done.
3) Finally, all directives are included with # for call tips. It works if you type ( (and if needed manually invoke the call tip). Of course, don't forget to backspace the ( when you are done.
Most functions have at least 2 pages.
1) Page 1 is the basic syntax.
2) Page 2 is some kind of help, whatever I found to be useful. If I found more info useful, in many cases I added extra pages.
I also included Call Tips for several flow control statements in order to have quick examples at the ready. Just type a ( after the flow control statement, and backspace it when you are done.
Install:
place the file(s) in ...\autoCompletion
syntax highlighting UDL is required for these to work (see above)
Usage:
manually invoke Auto-Complete with CTRL+Space (default)
manually invoke Call Tips with CTRL+SHIFT+Space (default)
press ALT+ and ALT+ to navigate the pages of the Call Tips when multiple pages exist
Notepad++ settings can be set to automatically show Call Tips and Auto-Complete: Settings > Preferences... > Auto-Completion
I recommend "Function Completion" only. This will allow functioning Call Tips as well as Auto-Complete for functions, #directives, and built-in variables.
Notepad++ has limitations that I needed to work around. This explains several quirks of this "solution" for call tips, and why I listed #directives with _directive, directive_, and #directive. There are no directives that begin or end with an underscore. So don't forget to remove the underscore (_) after doing an Auto-Complete.
Also, typing a ( after a #directive and most flow control statements is DEFINITELY not the correct syntax. This is basically the easiest way to include Call Tips for some of these elements and make them easily accessible.
WHEN IN DOUBT, USE THE HELP FILE!!!
I made the call tips so that I don't have to dig into the help file as often, particularly when I know what function I want to use, but I need to remember what the parameters are. But I did not put every bit of pertinent info into the Call Tips. Therefore, these Call Tips are ABSOLUTELY NOT a replacement for the help file.
It is technically not ideal, but it works for my uses, and as long as you remember the correct syntax to use when typing code, it will work for you too. Just don't forget to backspace the ( and extra _ when it doesn't belong (which will be most of the time).
The new update is MUCH more complete and functional than before.
Now you have AutoComplete + Function Hints, and syntax highlighting for:
Functions (+ hints)
Commands (+ hints)
Objects (+ hints)
Methods (+ hints)
Properties (+ hints)
Variables
Flow Control Keywords
Keys List
AHK1 and 2 is included in these files, and the hint data shows you which version of AHK the keyword applies to.
Basics: Type keyword and press . (period) for hint window. Press Backspace to close window and remove the .. This workaround is what allows me to create hint data for all these types of syntax elements.
ToDo:
I'm going to revise this, now that I have the script done and I've defined the format that's easy to work with, I can just edit the source files and make much more descriptive and helpful hints.
I might try and turn this into a script that runs in the background, and will hopefully be compatible with any text editor, using CaretGetPos([OutputVarX, OutputVarY]). If this works then I'll include URL's to help docs as much as possible in a future update.
Would it be possible to extend this script to allow to paste a full snippet and not only a single command?
E.g. when typing „Switch“ not Only Switch Expression but
I meant via the auto completion mechanism of npp. I didn’t find a way to add linebreaks or indentation to the output of the auto completion mechanism. Did you?
the only possible way that MIGHT work is to use 
. It works in making a multi-line description for call tips, but this might not work for auto-complete.
Are you trying to get a hotstring effect similar to AHK, but happening in NPP?
In npp you can choose between different autocomplete when there are more options, e.g. different set of parameters or command options. But it is only for a single line of code. I would like to add an option to autocomplete also a code block. I do not want to have two different systems for autocomplete.
Hi, your AHK NPP highliting fails at the ahk script of EitherMouse 0.81. Please check it out if you want, you can download EitherMouse ahk in the zip from their website: eithermouse.com
@TheArkive, can this be used along with your other tool that you posted in the v2 section or would it interfere with it? Basically, I'd like to add v2 syntax highlighting to Notepad++ capability alongside your other tool.
@boiler
Yes you can use this, though i suggest not using the auto-complete / call tips in notepad++.
EDIT: I mean, it's not a good idea to use CallTipsForAll and notepad++ call tips / auto-complete at the same time.
@Beholder
Thanks, I know there are a few different keywords I've missed. Can you give a few examples of missed keywords? I'll check out eithermouse and see if I can see them too.
EDIT: Ah yes, strings, and handling `" for highlighting. I'll see what I can do, but I like my strings to be a different color. I actually never use `" specifically because of that. I usually use q := Chr(34) or something like that to use literal quotes.
EDIT: @Beholder
How does this syntax highlighting fail? The one you linked to (which i have used before, and is still good of course) does the same thing when `" is used. I only posted this one because I didn't see an AHK v1 and v2 combined version. That is what this is supposed to be.
Last edited by TheArkive on 18 Jun 2020, 08:57, edited 1 time in total.
Not trying to brag, but I think my call-tips / auto-complete are better. Notepad++ call tips don't easily support commands / functions / methods, specifically for AHK. Of course for other languages I would assume Notepad++ call-tips and auto-complete is perfectly fine.
EDIT: Specifically, I was referring to not using CallTipsForAll and Notepad++ call tips / auto-complete at the same time.
Didn't mean to make such a broad statement, I'll modify that. Thanks.
@TheArkive - Thanks. I thought it was all one package. I should have realized that it would just be an XML file that could be used independently of the other stuff. Works well.