Skip to content
This repository was archived by the owner on Mar 3, 2023. It is now read-only.
This repository was archived by the owner on Mar 3, 2023. It is now read-only.

Long line breaks syntax highlighting #1667

Closed

Description

@sroberts

I opened a Python file with the following line (#963):

                    PrintAndLog(u"SSID: " + RememberedNetwork["SSIDString"].decode("utf-8") + u" - BSSID: " + RememberedNetwork["CachedScanRecord"]["BSSID"] + u" - RSSI: " + str(RememberedNetwork["CachedScanRecord"]["RSSI"]) + u" - Last connected: " + str(RememberedNetwork["LastConnected"]) + u" - Security type: " +  RememberedNetwork["SecurityType"] + u" - Geolocation: " + Geolocation, "INFO")

Which led to the following bug:
screen shot 2014-03-03 at 2 52 40 pm

You can find this as the main file in osxauditor.py.

Activity

  1. probablycorey commented on Jun 25, 2014

    @probablycorey

    This is a result of a parsing optimization that only parses X tokens per line.

  2. izuzak commented on Jun 28, 2014

    @izuzak
    Contributor

    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.

  3. bendman commented on Jul 16, 2014

    @bendman

    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.

  4. zacharyowen commented on Aug 7, 2014

    @zacharyowen

    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.

    screen shot 2014-08-06 at 11 34 20 am

  5. izuzak commented on Aug 8, 2014

    @izuzak
    Contributor

    @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!

  6. covard commented on Sep 15, 2014

    @covard

    I have the same issue.

    screen shot 2014-09-15 at 9 58 26 am

  7. PabloWenger commented on Sep 24, 2014

    @PabloWenger

    Similar problem here... any solution ?

  8. obskyr commented on Oct 14, 2014

    @obskyr

    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.

  9. wyqydsyq commented on Oct 30, 2014

    @wyqydsyq

    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.

  10. jfexyz commented on Oct 30, 2014

    @jfexyz

    👍 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).

  11. DSpeichert commented on Oct 30, 2014

    @DSpeichert

    +1 on making it configurable as a workaround

  12. jfexyz commented on Nov 27, 2014

    @jfexyz

    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

  13. postcasio commented on Dec 4, 2014

    @postcasio
    Contributor
  14. jfexyz commented on Dec 4, 2014

    @jfexyz

    @postcasio Excellent, thanks!

  15. 40 remaining items

  16. cronoklee commented on Apr 20, 2018

    @cronoklee
  17. Stanzilla commented on Apr 20, 2018

    @Stanzilla
  18. maxbrunsfeld commented on Apr 20, 2018

    @maxbrunsfeld
    Contributor

    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.

    See #16299 for more information.

  19. added a commit that references this issue on Jun 18, 2018
  20. rubo77 commented on Jun 18, 2018

    @rubo77

    I cracked it down a bit: in my php file I get this error with

    $what= " SELECT 'x' 'x' 'x' 'x' 'x' 'x' 'x' 'x' 'x' 'x' 'x' 'x' 'x' 'x' 'x' 'x' 'x' 'x' 'x' 'x' 'x' 'x' 'x'
    		";
    

    but not without the linebreak or with one x less

  21. cronoklee commented on Jun 25, 2018

    @cronoklee
  22. winstliu commented on Jun 26, 2018

    @winstliu
    Contributor
  23. fatbasstard commented on Jul 20, 2018

    @fatbasstard

    Just hit the same with adding a huge RegEx.. Code (Python) works like a charm, just the lighlighting that breaks it..

    image

    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.

  24. Aerijo commented on Jul 20, 2018

    @Aerijo
    Contributor

    @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.

  25. mgilank commented on Aug 18, 2018

    @mgilank

    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

  26. virtualwatt commented on Nov 15, 2018

    @virtualwatt

    OMG the issue is open since early 2014 and still not resolved :) Just closed as a dup #94.

  27. lee-dohm commented on Nov 15, 2018

    @lee-dohm
    Contributor

    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.

    I hope that helps!

  28. lock commented on May 14, 2019

    @lock

    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!

  29. locked as resolved and limited conversation to collaborators on May 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions