With the release of the new RegisterAutocompleteCallback function, I think its time to ship something like this.
Get documentation for any library, function or object
Given it has a .docfile module, Docfile can provide typing for many libraries almost straight away when the Auto-register new .DOCFILE objects action is enabled
{
MacroName: string -- used internally to pair modules and callback to documentation
TargetFIleName: string -- string pattern to match against, ie: %.spec$ matches against scripts ending in .spec
Patterns: {
{ --used to write overwrite rules
MatchMode: string -- what key to match against in the response body
Value: string -- value to match against key
Overrides: {[string]: any} -- values to override if match is found
}
}
ChildPatterns: { --same as patterns but used for matching sub-objects
{ --denotes a group that needs to be matched
{Pattern} -- see pattern
}
},
Injects: ([string]: any} -- extra members to add to the autocomplete, only used if no child matches are found
}
An example of this struct is as follows, this is based on the Tabby framework
Setting this to true will make the internal child pattern searcher not respect the size of the response body when matching. This is designed for debugging autocompletes
Comic Mono is the best font I’ve used in a while, its something I’ve found is the best font for me over what I previously used, Fira Code (which dont get me wrong, thats a good font as well).
Font choice is personal preference, if you dont like it, it doesn’t mean somone also doesn’t like it. Its the same principle as editor themes.
Question, how did you manage to get the replacement text to function properly?
Working on my own verison of a plugin atm but I can’t get past the textEdit.
It’s nearly complete the only issue is that when the snippet of code is replaced where the autocomplete is detected.
it doesn’t implement any autocomplete macros (unless you use the scary Injects key), the plugin is designed to match against keywords (MatchMode) with a value and then override it from the overrides table
Yeah it’s a struggle.
You’d think there would be info on the doc website aswell.
(Also kinda annoyed there is no GetAutocompleteCallback method so you sometimes have to blindly call DeregisterAutocompleteCallback and deal with an error or not.)