Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Syntax highlight issue with destructuring expressions within string interpolations #97

Closed

Description

@bkuri

screenshot at 00-28-59

Activity

  1. changed the title [-]Syntax highlighter issue when destructuring expressions[/-] [+]Syntax highlight issue with destructuring expressions within string interpolations[/+] on Jul 10, 2016
  2. winstliu commented on Jul 15, 2016

    @winstliu
    Contributor

    Confirmed using language-coffee-script 0.47.1.

    output.write "<script>#{ compile(source, {bare}) }</script>"
  3. added a commit that references this issue on Oct 9, 2016
    790a3ca
  4. t9md commented on Dec 1, 2016

    @t9md

    I believe issue below has same cause, so put here.

    Problem: Using object destructuring assignment make syntax-highlight wired after that row.

    incorrect-hl-object-destructuring-assignment

    Below is exactly same code I used in above GIF.

      getPreviousStartOfSentence: (fromPoint) ->
        scanRange = new Range(fromPoint, [0, 0])
        foundPoint = null
        @editor.backwardsScanInBufferRange @sentenceRegex, scanRange, ({range, match, stop, matchText}) =>
          if match[1]?
    
            # [LOOK] Comment in/out change syntax highlight to EOF
            {start: {row: startRow}, end: {row: endRow}} = range
    
            if not @isBlankRow(endRow) and @isBlankRow(startRow)
              point = @getFirstCharacterPositionForRow(endRow)
              if point.isLessThan(fromPoint)
                foundPoint = point
              else
                return if @skipBlankRow
                foundPoint = @getFirstCharacterPositionForRow(startRow)
          else
            if range.end.isLessThan(fromPoint)
              foundPoint = range.end
          stop() if foundPoint?
        foundPoint ? scanRange.start
  5. winstliu commented on Dec 1, 2016

    @winstliu
    Contributor

    @t9md your issue is actually different. Can you please test out #106?

  6. t9md commented on Dec 1, 2016

    @t9md

    @50Wliu

    Thanks, I tried wl-more-destructuring-fixes branch and was OK, FIXED for the issue "object destructuring assignment make syntax-highlight wired".

    Thanks

    incorrect-hl-object-destructuring-assignment-fixed

    Versions I checked with.

    • Stable
    Atom    : 1.12.6
    Electron: 1.3.9
    Chrome  : 52.0.2743.82
    Node    : 6.5.0
    
    • Beta
    Atom    : 1.13.0-beta6
    Electron: 1.3.9
    Chrome  : 52.0.2743.82
    Node    : 6.5.0
    
  7. t9md commented on Dec 1, 2016

    @t9md

    @50Wliu Is this accidentally closed?

    I didn't checked for original issue "Syntax highlight issue with destructuring expressions within string interpolations".

  8. winstliu commented on Dec 1, 2016

    @winstliu
    Contributor

    Whoops! Didn't think my commit message would close it.

  9. dcalhoun commented on Jan 9, 2017

    @dcalhoun

    This may not be directly related, but I've seen the syntax highlighting break with the following as well. Commenting out the first line will change the colors of the second.

    foo = [0, [1, 2]]
    this.$el.remove()

    Let me know if I should create a separate issue.

  10. winstliu commented on Jan 9, 2017

    @winstliu
    Contributor

    @dcalhoun I can't reproduce that using the latest language-coffee-script version so I'm going that it's been fixed.

  11. ashthespy commented on Apr 1, 2017

    @ashthespy

    Also unsure if related, but have issues with using / inside a string like so:

    with v 0.48.5

    Edit: On looking around - Duplicate of #118 and is fixed in #119
    Cheers!

  12. winstliu commented on Apr 2, 2017

    @winstliu
    Contributor

    I believe that's been fixed in the latest version, and should be out in Atom 1.16.0 or 1.17.0.

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