You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 3, 2023. It is now read-only.
Checked that there is not already an Atom package that provides the described functionality: https://atom.io/packages
Description
While investigating winstliu/language-hclrs#4, I root-caused the issue to using a newer tree-sitter version than Atom supported. However, this was non-obvious, and the only place it was reported was in the console.
When loading grammars, loadGrammar checks to make sure that readGrammar succeeds:
Whoops, didn't search for the right keywords 😊. Figures that this has already been reported.
I'll keep this one open to track the fact that loadGrammar is unreliable at reporting errors, and #22129 seems better suited to tracking how Atom can support languages that use tree-sitter 0.19.0+ :).
This also seems to be happening outside of GrammarRegistry.loadGrammar. In particular, if a "working" tree-sitter grammar is loaded but a "not working" grammar is injected into some part of it. Also, because injections can happen in multiple places, this could trigger multiple errors.
Uh oh!
There was an error while loading. Please reload this page.
Prerequisites
Description
While investigating winstliu/language-hclrs#4, I root-caused the issue to using a newer tree-sitter version than Atom supported. However, this was non-obvious, and the only place it was reported was in the console.
When loading grammars,
loadGrammar
checks to make sure thatreadGrammar
succeeds:atom/src/grammar-registry.js
Lines 552 to 553 in 3f4b251
However, there are no checks for the subsequent
addGrammar
call:atom/src/grammar-registry.js
Lines 554 to 555 in 3f4b251
Even though addGrammar can fail when (eventually) calling TreeSitterLanguageMode.parse, which itself calls
parser.setLanguage
which can throw.atom/src/tree-sitter-language-mode.js
Line 117 in 3f4b251
Resulting in e.g.

Steps to Reproduce
Expected behavior:
A helpful error notificaton.
Actual behavior:
Nothing! Why isn't my syntax highlighting working?
Reproduces how often:
100%
Versions
1.58.0, Windows 11 Insider.
Additional Information
N/A
The text was updated successfully, but these errors were encountered: