James-Yu / LaTeX-Workshop

Boost LaTeX typesetting efficiency with preview, compile, autocomplete, colorize, and more.
MIT License
10.69k stars 531 forks source link

Syntax Highlighting for Asymptote files (.asy) #358

Closed sivapvarma closed 6 years ago

sivapvarma commented 6 years ago

Currently Asymptote (.asy) files are treated as plain text.

vscode-asy-plain

Here is the same file in TeXStudio

texstudio-asy

Since asymptote has C++ like syntax, changing language to C++ helps a bit (but this has to be done manually ?)

vscode-asy

It would be cool to have dedicated support for asymptote.

If you are on a mac, you install asymptote using tlmgr

sudo tlmgr install asymptote
James-Yu commented 6 years ago

Unfortunately, syntax highlight in vscode uses the textmate engine, for which I cannot find the highlighter of asymptote files. For instance, the one for LaTeX is available at https://github.com/textmate/latex.tmbundle .

jlelong commented 6 years ago

I find it a bit strange to implement asymptote syntax into this package. For instance, there is a separate package for Atom. If the asymptote language were implemented in an extension for vscode, what could be done is to highlight the asy environment using this style thanks to the embedding mechanism.

jlelong commented 6 years ago

Everything inside \begin{asy}...\end{asy} is recognized as Asymptote code. Note that to make it work, you first need to install the Asymptote extension.