Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autocomplete enum-like options #605

Open
maxitg opened this issue Feb 3, 2021 · 0 comments
Open

Autocomplete enum-like options #605

maxitg opened this issue Feb 3, 2021 · 0 comments
Labels
convenience Syntax improvements that don't significantly change functionality wolfram language Requires Wolfram Language implementation

Comments

@maxitg
Copy link
Owner

maxitg commented Feb 3, 2021

The problem

We have some options the values of which contain strings that should support autocompletion. For example, "EventOrderingFunction".

Possible solution

Some built-in options, e.g., GraphLayout can do that already. We just need to find out how they are implemented. It might be necessity to switch options to use symbols instead of strings first (#604).

@maxitg maxitg added convenience Syntax improvements that don't significantly change functionality wolfram language Requires Wolfram Language implementation labels Feb 3, 2021
maxitg added a commit that referenced this issue Feb 7, 2021
…rmation and syntax autocompletion (#603)

## Changes

* In the Mathematica options inspector, there is an option called `"HighlightMissingArgumentsWithTemplate"`.
* If you turn it on, in case of missing arguments, instead of displaying a single red arrow, you will get a helpful hint with argument names which can serve as a super fast lightweight documentation (like you would get in, e.g., Xcode after autocompleting a function):

<img width="362.4" alt="HighlightMissingArgumentsWithTemplate" src="https://user-images.githubusercontent.com/1479325/106001860-133b6880-6076-11eb-8fd8-a8549dfe4ac6.png">

* The names of the arguments are taken from pattern names in `SyntaxInformation`.
* This PR adds names to all `SyntaxInformation` except for the built-in `RulePlot` thus enabling this feature for all *SetReplace* symbols.

* This also adds missing usage messages, syntax information, and syntax autocompletion.
* Expands argument names in usage messages to be descriptive so that using autocompleted templates are more informative.

## Comments

* `Null` is due to `OptionsPattern[]`. It can be changed to, say, `opts` if that pattern is named as `opts : OptionsPattern[]`. However, if one does that, some optional arguments will always be displayed in the template, which is, of course, unacceptable. I think we'll have to wait until this weed is fixed upstream:

<img width="324.0" alt="image" src="https://user-images.githubusercontent.com/1479325/106002768-200c8c00-6077-11eb-9d79-3a4e07caa2bc.png">

* Autocompletion is generally disabled for option names. The problem is that I'm not aware of a way to enable autocompletion for multiple arguments at a time. In order to solve this, we need to use symbols instead of strings for options (#604), and we need to figure out how to autocomplete the values for enum-like options (#605).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
convenience Syntax improvements that don't significantly change functionality wolfram language Requires Wolfram Language implementation
Projects
None yet
Development

No branches or pull requests

1 participant