-
-
Notifications
You must be signed in to change notification settings - Fork 91
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
Included non-LaTeX code shows IJ errors // Language Injection #101
Comments
Seems to me as an important issue. We can utilize the language injection mechanism to solve this, which gives the extra benefit that you the Mathematica code inside the listings environment gets highlighted as well (when you have the MMa support plugin installed). |
Currently this also will generate a (bit confusing) inspection warning |
Because it doesn't parse correctly, it doesn't detect a document environment thus causing the error. |
Thoughts about the progress so far: This really turns out to be a non-trivial tasks for a lexer/parser system as currently present in the plugin. Detecting where to switch off the parser would be much more achievable at a higher abstraction level, specifically at the parser or AST level. Looking forward, one way of achieving this, is to change from a lexer/parser structure to generalized parsing. |
I use the Listings package, but it will generate errors. For example,
produces
<content> or LatexTokenType.\end expected, got '*'
on hovering over the
(*
.I don't have suggestions how to detect foreign code though - but listings, minted and the verbatim environment (also the inline version) cover most use cases I guess.
List of examples to be covered by language injection
.
- [ ]Use something like%(...)s
string interpolation"""\\begin{{equation}}{0}""".format(2)
instead#620: Python string interpolation with %
%s
and%(...)s
are not comments but Python\newmintinline
(similar problem as with doing\newenvironment{myenv}{\verb|}{|}
)#807: Minted package with \newmintinline
The text was updated successfully, but these errors were encountered: