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

Strange highlighting after 0.17.0 update #283

Closed

Description

@roflomglol

Your environment

  • vscode-ruby version: 0.17.0
  • Ruby version: 2.5.0
  • VS Code version: 1.20.1
  • Operating System: macOS High Sierra 10.13.3
  • Hardware (optional):

Expected behavior

Syntax highlighting behaves predictably.

Actual behavior

After update 0.17.0 I seed odd highlighting and I wonder if it's expected behaviour. Example:

image

I don't think method call .three['a'] highlighting must differ.

image

Here It's probably intended but I don't get why highlighting of method call with and without parentheses must differ.

Steps to reproduce the problem

It may depend on a color scheme. But even though there is no issue on a default Light (Visual studio) it does behave odd on a default Solarized Light.

image

It's hard to describe how to reproduce. I just hope examples will help you. Thanks in advance. :)

Activity

  1. wingrunr21 commented on Mar 6, 2018

    @wingrunr21
    Collaborator

    Can you use the Developer: Inspect TM Scopes tool to tell me what the detected scopes are for the various use cases (you can find that tool via the command palette).

    Also, is this highlighting different than v0.15.0?

    #251 was what asked for this kind of highlighting to be put back. The highlighting doesn't really have any "smarts", it just assumes things are various language constructs.

  2. roflomglol commented on Mar 7, 2018

    @roflomglol
    Author

    Yeah, sure. Here it is:

    8
    7
    6
    5
    4
    3
    2
    1

    The code:

      def example
        { a: one.two&.three }
        one.two&.three
    
        { b: one.two&.three || four }
        one.two&.three || four
    
        { c: "".downcase }
        {
          d: "".downcase
        }
    
        one.two['kpp']
      end
    end
    

    I can't tell for certain that it wasn't the issue in previous versions, but I've noticed it only after 0.17 and I'm using VS Code for some time now, so something have changed in the last version. If you tell me how to rollback to previous version, I can compare.

  3. wingrunr21 commented on Mar 7, 2018

    @wingrunr21
    Collaborator

    Ok cool. No, this is good thanks. When you see source.ruby it basically means "I know this is Ruby but no other pattern in the grammar matches this". It appears some of those method calls are being interpreted as variable.other.ruby. This was a change made at the request of those in #251 to make the grammar more optimistic. I'll need to take a look at how the grammar is detecting this code.

    There's also varying levels of support across themes. When you say the Light theme works without issue but Solarized does not, it makes me think there are some grammar scopes missing.

    I will say the instance of || four is going to be basically impossible to highlight correctly 100% of the time. That circumstance could easily be a variable or a method call and we won't be able to make that determination based on pure regular expressions.

  4. roflomglol commented on Mar 7, 2018

    @roflomglol
    Author

    Thank you for your explanation. The problem I see here is that it behaves differently in, at least in my opinion, the same situations. why does four highlighting differ in { b: one.two&.three || four } and one.two&.three || four and the same goes for downcase color of which depends on if the hash is oneline or multiline.

    You guys are doing great and I'm fine if there will be some edge cases but I just wish there was consistency. Like, okay, || four may be variable, but in one case its source.ruby in the other variable.other.ruby and the difference is the one is surrounded with curly braces and the other is not. Thats odd in my opinion. :)

  5. wingrunr21 commented on Mar 7, 2018

    @wingrunr21
    Collaborator

    Agreed, it needs to be looked into.

  6. andrewmcodes commented on Sep 14, 2018

    @andrewmcodes

    Is this still an issue with 0.20.0?

  7. roflomglol commented on Sep 25, 2018

    @roflomglol
    Author

    @andrewmcodes It seems so, yes.

  8. github-actions commented on Aug 16, 2020

    @github-actions

    This issue has not had activity for 30 days. It will be automatically closed in 7 days.

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