Closed GroggyOtter closed 3 months ago
But '{Alt}' has an Intellisense type of "keyword". And '{Blind}' has a type of "text".
They should be provided by built-in completions.
Can't reproduce the problem, it works normally in my place.
There's an X factor here somewhere.
One of the other keys must be causing this problem.
Give me a second to find out which it is.
What you're showing on your image post is EXACTLY what I was striving for.
Also, xie xie for taking time to respond to my questions and helping me learn more about all this.
I think I figured out the problem.
The issue was the parameter name and the fact that I didn't understand you could apply definitions from the json file to the def file (I feel like I don't know anything about how this addon works...)
I trimmed my test case down to this:
@param {String|'{Alt}'|'{AppsKey}'|'{Backspace}'|'{Browser_Back}'} Keys
And this is the what was showing up:
I realized that the only place some of those key names appears is in the ahk.json
file.
Is that how this works?
Send()
parameter's tag name is keys
so it applies the information from the keys
object in the json file?
Yes, similar to WinTitle
, etc., because they appear in many built-in functions and reuse these completions
Also keep in mind that if you press Ctrl + Space
withouth adding the quotes first you might get the text suggestions instead of what you are looking for:
When you add the quotes first and then use Ctrl + Space
I get what you were expecting:
Yes, similar to
WinTitle
, etc., because they appear in many built-in functions and reuse these completions
Thanks.
I'm currently struggling with making use of the JSON file like I want.
There's a structuring rule or something I'm not following and IDK what it is.
First, here's a link to the ahk2.json
file I'm working with.
It's primarily the same as the original, with some minor changes.
The two big changes I recently made were the addition of 2 properties:
keysend
is added to the root object and was based off of the keys
entry.
There's also an mboptions
entry in the options
property of the object.
If I use the default keys
as a name for an @param tag in the definition file, the keys show up in the autocomplete as expected.
I have keys
applied to SendEvent() and it works.
It even knows to identify key names as "keywords" and the modes, like blind/raw/text, as "text" words.
But when I apply my keysend
property to an @param tag, it doesn't work at all.
Instead, it gives me a huge list of words that have nothing to do with the list items provided (and some words don't even exist in the json text)
I've tried various things and can't get it to work correctly.
I also tested another scenario.
I chose MsgBox's "options" parameter and made an "mboptions" entry under the "options" property of the JSON file.
It contains all the different text options message box's 3rd parameter can use.
"mboptions": [
{
"body":"OK"
},
{
"body":"OKCancel"
},
{
"body":"AbortRetryIgnore"
},
{
"body":"YesNoCancel"
},
{
"body":"YesNo"
},
{
"body":"RetryCancel"
},
{
"body":"CancelTryAgainContinue"
},
{
"body":"IconX"
},
{
"body":"Icon?"
},
{
"body":"Icon!"
},
{
"body":"Iconi"
},
{
"body":"Default2"
},
{
"body":"Default3"
},
{
"body":"Default4"
}
],
In the definition file, I set the 3rd @param to mboptions
.
@param {String} [MBOptions]
And just like keysend
, I get a list full of words that have nothing to do with MsgBox.
It's the exact same malformed list that keysend
produced:
I love the functionality of having wrapped key names when using send, but I can't stand that my current tooltips have this huge, ridiculous line of keys displayed:
This does not happen when using the keys
option.
Which is why I want to import a lot of my autocomplete lists into the json file.
Can you please help me out with this?
What is the correct format or structure to do this?
Can it be done?? Or does this require altering the server files to work?
Last question: can you please explain what the differences between options
vs texts
in the JSON file?
Thanks so much for your time and effort.
/**
* @typedef {...} typename
*/
I plan to group option strings by function, but I haven't started yet, so they're all in texts right now.
I'm sorry, but I don't understand.
I tried implementing a @typedef tag (in a few different ways) and couldn't get it to work as intended.
Also, the main question I asked wasn't addressed.
How do I correctly add option lists to the ahk2.json file so that it can be used in the definition file?
Similar to how Keys works.
Or is this not currently possible?
I plan to group option strings by function
Check out my current definition file.
I added options for almost everything that accepts a pre-defined value.
With a few regex replacements, you can scrape and format all of it and save yourself a lot of typing.
I forgot, it hasn't happened yet.
I plan to group option strings by function, but I haven't started yet, so they're all in texts right now.
This might help: https://pastebin.com/9p8kdduC
It's a list of all function and method parameters that have "auto complete" lists in my def file.
You can parse through it/check against it/whatever you want.
This is a private link and cannot display its content.
It's "pending moderation" I guess.
Posted it to GitHub:
https://github.com/GroggyOtter/GroggyRepo/blob/master/temp/ahkv2%20options%20list.txt
/** * @typedef {...} typename */
I plan to group option strings by function, but I haven't started yet, so they're all in texts right now.
hope this gets implemented at some point, really handy.
Addon version: v2.4.8
When creating an
@param
JSDoc tags, the addon allows for different selections, delimited by pipes.It works well but I cannot find a way to produce literal curly brace characters:
{
and}
Example:Expected menu text:
Actual menu text:
I also tried different types of escapes.
None of these worked:
Please advise how to create literal curly braces.
Going a step further, can you please provide guidance or instructions on how to correctly utilize the
@Param {}
syntax?Or some kind of documentation that explains it.
I don't understand why adding this
'Alt'
and an Intellisense type of "value/enum".But
'{Alt}'
has an Intellisense type of "keyword".And
'{Blind}'
has a type of "text".Why does
{}
change the type and not produce actual characters?What are the rules for this syntax?