-
Notifications
You must be signed in to change notification settings - Fork 56
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
Unsupported regex in md-math-block.tmLanguage.json #525
Comments
The solution is probably to remove the "Markdown Math" grammars in |
Also, |
Also, I think tm4e should handle unsupported regexes and other problems with the grammar files more gracefully. Instead of just logging the error an error dialog should be displayed that explains the problem. |
all the proposals would be welcome as pull requests ;) |
@jensli Maybe this should be reported in the upstream repo instead: https://github.com/microsoft/vscode/blob/main/extensions/markdown-math/syntaxes/md-math-block.tmLanguage.json#L16 If joni does not support this, then this is probably not a valid Oniguruma style regex, which is required by textmate syntax. https://macromates.com/manual/en/regular_expressions#syntax_oniguruma |
@sebthom Good idea. I will check. Also: I plan to provide a PR disabling the invalid grammar. Also: I'll have a look and try to improve error handling in general. Since all loading is lazy it is hard to find a good place to report problems. Also, the problem with this grammar is re-encountered and reported many times a second in the look by the update thread. I'll try to do something about that. |
If joni supports it it could be interesting to see if vscode supports. As tm4e is a port of vscode-textmate perhaps we should upgrade it again. |
@angelozerr we are using the latest joni release and are in sync with latest vscode-textmate changes. |
Oniguruma also rejects the regex, with exactly then same error message:
Tested at jdoodle.com using Ruby 3.0.2. I will file a bug upstream. Do anyone know what regex implementation that Visual Studio Code uses? |
Based on https://github.com/microsoft/vscode-textmate#using I would say they use https://github.com/microsoft/vscode-oniguruma |
This regex in https://github.com/eclipse/tm4e/blob/ac34c5f440f95e1046ecb69b1c3c5c8514cb4a86/org.eclipse.tm4e.language_pack/markdown-math/md-math-block.tmLanguage.json#L16
...is not supported by Joni.
The result if that when the line gets selected in Preferences > TextMate > Grammars the following exception is logged:
Stack trace:
The text was updated successfully, but these errors were encountered: