Function Repository Resource:

AddCodeCompletion

Source Notebook

Adds code completion to your function’s arguments

Contributed by: Arnoud Buzing

ResourceFunction["AddCodeCompletion"]["function"][arg1,arg2, ]

adds code completions to "function" for each argi.

Details and Options

Each argi can be one of the following:
{string1,string2,}a list of possible string completions
Noneno completion
"AbsoluteFileName"absolute filename completion
"RelativeFileName"relative filename completion
"Color"color completion
"PackageName"package name completion
"DirectoryName"directory name completion
"InterpreterType"interpreter type completion
"Style"style completion

Examples

Basic Examples (3) 

Add a list of strings as possible code completions for the "ohmy" function:

In[1]:=
ResourceFunction["AddCodeCompletion"]["ohmy"][{"lions", "tigers", "bears"}]
Out[1]=

Code completions appear when the first double quote is typed:


Add a file name code completion for the "fileopen" function:

In[2]:=
ResourceFunction["AddCodeCompletion"]["fileopen"]["AbsoluteFileName"]
Out[2]=

Code completions appear when the beginning of an absolute file name is detected:


Add code completion for a function with multiple arguments:

In[3]:=
ResourceFunction["AddCodeCompletion"]["animals"][{"cat", "dog", "mouse"}, {"horse", "cow", "pig"}]
Out[3]=

Code completions appear for each argument:

Publisher

Arnoud Buzing

Requirements

Wolfram Language 11.3 (March 2018) or above

Version History

  • 1.0.0 – 11 March 2019

License Information