Message Boards Message Boards


Add Custom Autocompletions

Posted 9 months ago
0 Replies
1 Total Likes

Mathematica can add autocompletions to functions very nicely. There are ways to do this you can find on the stack-exchange, but operationally they look like:

AddFunctionAutocompletions[myFunc, {{"arg1", "arg2", "arg3"}}];

And then I can test this like:


enter image description here

But how the front-end does this for Entity is beyond me and something I'd love to have. Consider this:

enter image description here

But the box form of this looks like:

ToBoxes@Entity["Country", "China"]

     "Entity", "[", 
       RowBox[{"\"Country\"", ",", "\"China\""}], 
 "\"Entity[\\\"Country\\\", \\\"China\\\"]\"", 

Some simple debugging lets me know that all the FE is doing is using the second argument to that TemplateBox to get this out, but how it does that is beyond me and how this is set in the kernel I don't know. do I do this myself? This would be a great feature to have for OOP.

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract