Closed Bob131 closed 2 years ago
You can currently get this list with
asy -l
or
asy -l examples/venn
but I agree that an asy function like
string[] global()
returning a list of global functions and variables would be convenient.
For now I will close this issue until you have had a chance to try out the language server protocol now in the master branch and upcoming 2.71 release. It should provide some of the functionality you are looking for, along with a systematic framework for further development.
Playing around with it, the Emacs
asy-mode
seems a little anaemic: comparable Emacs packages likepython-mode
or Geiser are able to interface with a running interpreter to provide lots of nice integrations (xref, eldoc, symbol completion, inline documentation, etc). However, the Asymptote language is missing the introspection facilities required to beef upasy-mode
. I have some proposals:Probably the most important part is being able to inspect the variable bindings of the current environment. I'm thinking a patch like the following should do the job. (diff 86954d8680ae6a6d3e416fa3a7dea56c97e39662)
This would enable greatly improved completion and would help a bit with eldoc. This particular implementation might be a little too blunt, though; someone with more familiarity with the Asymptote code base might want to adjust it to return a list of strings that can be manipulated by code running in the interpreter.
For everything else (xref, eldoc, etc), the heavy use of function overloading seems to present a challenge.