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.
Repository navigation
This repository was archived by the owner on Mar 3, 2023. It is now read-only.
Just for reference, the max 100 tokens per line limit is defined in Atom here. I'm going to refer related issues from language-* packages to this issue.
This is a complicated issue, because until token parsing is sped up this will need some limit. Maybe a decent solution for now, or along side the limit, is to reset the scope on the next line. This would at least isolate most broken syntax highlighting to the culprit line, rather than propagating to the remainder of the file.
I'm not sure if I am experiencing the same issue, but I am seeing similar behavior in a shell script that I am working on. I have just started poking around in Atom so forgive me if I cannot contribute very much, but perhaps my experience will assist. Attached is a screenshot.
@zacharyowen Yeah, that seems to be the same issue -- it's a long line and syntax highlighting breaks after a certain number of tokens. Sorry if this is causing problems for you!
This breaks the syntax highlighting in the Markdown preview pane, too. Might not be all too surprising, as I'm guessing it uses the same highlighting code.
Bumping this — perhaps a good temporary workaround for the meantime would be to allow users to set the token limit themselves in the Atom config rather than it being hard-coded, that way those of us running more powerful machines could set it to a higher amount as the performance impact would be negligible.
Reacted by Trevor, Jan Heinrich Merker, Jordie Bodlay and Apurva
Yup, it's already fixed for selected languages including Python if you opt into our new syntax highlighting system. Check the Use Tree-sitter Parsers checkbox in the settings view. There are still some issues with the new system, so it'll be off by default for a few months, but it's superior in many ways, including the fact that it can highlight lines of unlimited length.
Just hit the same with adding a huge RegEx.. Code (Python) works like a charm, just the lighlighting that breaks it..
FYI: I didn't keep this string in this format (restructured it) but it would be nice if this can be fixed since it gives you (the user) the impression that a mistake is made.
@fatbasstard It has been fixed, as stated in maxbrunsfeld’s post above. You need to enable tree-sitter parsers to see it. Currently, they have somewhat less syntax highlighting than you may be used to. However, this will improve as they come out of beta/trial status.
The root cause of the problem has been fixed by the integration of the tree-sitter grammar system as the default in Atom. While it is true that not every bundled language has a tree-sitter grammar, that will be achieved over time. We're in the process of marking all of our bundled grammar repos with the tree-sitter topic and atom.io keyword so that people can easily see which languages have been updated.
This issue has been automatically locked since there has not been any recent activity after it was closed. If you can still reproduce this issue in Safe Mode then please open a new issue and fill out the entire issue template to ensure that we have enough information to address your issue. Thanks!
Activity
probablycorey commentedon Jun 25, 2014
This is a result of a parsing optimization that only parses X tokens per line.
izuzak commentedon Jun 28, 2014
Just for reference, the max 100 tokens per line limit is defined in Atom here. I'm going to refer related issues from language-* packages to this issue.
bendman commentedon Jul 16, 2014
This is a complicated issue, because until token parsing is sped up this will need some limit. Maybe a decent solution for now, or along side the limit, is to reset the scope on the next line. This would at least isolate most broken syntax highlighting to the culprit line, rather than propagating to the remainder of the file.
zacharyowen commentedon Aug 7, 2014
I'm not sure if I am experiencing the same issue, but I am seeing similar behavior in a shell script that I am working on. I have just started poking around in Atom so forgive me if I cannot contribute very much, but perhaps my experience will assist. Attached is a screenshot.
izuzak commentedon Aug 8, 2014
@zacharyowen Yeah, that seems to be the same issue -- it's a long line and syntax highlighting breaks after a certain number of tokens. Sorry if this is causing problems for you!
covard commentedon Sep 15, 2014
I have the same issue.
PabloWenger commentedon Sep 24, 2014
Similar problem here... any solution ?
obskyr commentedon Oct 14, 2014
This breaks the syntax highlighting in the Markdown preview pane, too. Might not be all too surprising, as I'm guessing it uses the same highlighting code.
wyqydsyq commentedon Oct 30, 2014
Bumping this — perhaps a good temporary workaround for the meantime would be to allow users to set the token limit themselves in the Atom config rather than it being hard-coded, that way those of us running more powerful machines could set it to a higher amount as the performance impact would be negligible.
jfexyz commentedon Oct 30, 2014
👍 If this isn't going to be changed, then some way to adjust and persist the value is required. Please add a config option (no UI would be fine).
DSpeichert commentedon Oct 30, 2014
+1 on making it configurable as a workaround
jfexyz commentedon Nov 27, 2014
In case anyone else is fixing this manually with every Atom update (ugh), the source has moved to here: https://github.com/atom/atom/blob/master/src/grammar-registry.coffee#L33
postcasio commentedon Dec 4, 2014
I've created a simple package to make this limit configurable: https://atom.io/packages/grammar-token-limit
jfexyz commentedon Dec 4, 2014
@postcasio Excellent, thanks!
40 remaining items
cronoklee commentedon Apr 20, 2018
Stanzilla commentedon Apr 20, 2018
maxbrunsfeld commentedon Apr 20, 2018
Yup, it's already fixed for selected languages including Python if you opt into our new syntax highlighting system. Check the
Use Tree-sitter Parserscheckbox in the settings view. There are still some issues with the new system, so it'll be off by default for a few months, but it's superior in many ways, including the fact that it can highlight lines of unlimited length.See #16299 for more information.
remove line limit in grammar
rubo77 commentedon Jun 18, 2018
I cracked it down a bit: in my php file I get this error with
but not without the linebreak or with one x less
cronoklee commentedon Jun 25, 2018
winstliu commentedon Jun 26, 2018
@cronoklee Your issue is atom/language-php#333.
fatbasstard commentedon Jul 20, 2018
Just hit the same with adding a huge RegEx.. Code (Python) works like a charm, just the lighlighting that breaks it..
FYI: I didn't keep this string in this format (restructured it) but it would be nice if this can be fixed since it gives you (the user) the impression that a mistake is made.
Aerijo commentedon Jul 20, 2018
@fatbasstard It has been fixed, as stated in maxbrunsfeld’s post above. You need to enable tree-sitter parsers to see it. Currently, they have somewhat less syntax highlighting than you may be used to. However, this will improve as they come out of beta/trial status.
mgilank commentedon Aug 18, 2018
i have check the "Use Tree Sitter Parsers" but still this doesn works. highlight become one color only
atom version : 1.29 in windows 10
virtualwatt commentedon Nov 15, 2018
OMG the issue is open since early 2014 and still not resolved :) Just closed as a dup #94.
lee-dohm commentedon Nov 15, 2018
The root cause of the problem has been fixed by the integration of the tree-sitter grammar system as the default in Atom. While it is true that not every bundled language has a tree-sitter grammar, that will be achieved over time. We're in the process of marking all of our bundled grammar repos with the
tree-sittertopic and atom.io keyword so that people can easily see which languages have been updated.I hope that helps!
lock commentedon May 14, 2019
This issue has been automatically locked since there has not been any recent activity after it was closed. If you can still reproduce this issue in Safe Mode then please open a new issue and fill out the entire issue template to ensure that we have enough information to address your issue. Thanks!