Skip to content

Indent guide highlighting is not semantic #49342

Closed

Description

Shouldn't the highlighted guide be the one with the blue arrow instead the one with the red when the cursor is at the green line?
screen shot 2018-05-07 at 09 39 40

Activity

  1. added
    editor-core
    on May 7, 2018
  2. Jupakabra commented on May 7, 2018

    @Jupakabra

    It's debatable, if you put cursor at "**/*.txt" you expect it to mark it's parent indent which is "todohighlight.include", and in this case you are marking "todohighlight.include" who's parent is whatever is at the top level, so it work correctly.

    One could argue that if selected child node has nodes it's children indent should be selected instead.

  3. augustocdias commented on May 7, 2018

    @augustocdias
    Author

    I agree that it is debatable... In my point of view if the cursor is after the block start it should move the highlighted guide to the next one. On the other hand, if the cursor is before, I agree with you Henry Jupak (@Jupakabra)

  4. added
    feature-request
    editor-rendering
    and removed
    editor-core
    on May 8, 2018
  5. changed the title [-]Highlighted ident guide error?[/-] [+]Highlight the next line's indent guide in this case[/+] on May 8, 2018
  6. changed the title [-]Highlight the next line's indent guide in this case[/-] [+]Indent guide highlighting is not semantic[/+] on May 8, 2018
  7. alexdima commented on May 8, 2018

    @alexdima
    Member

    Another example from Tresky (@Tresky) in #49384

    Sample Code

    function foo (cb) { // this scope gets highlighted
    |   // placing cursor on if-statement on the below line will highlight the tab for the function-scope; expected the if-scope.
    |   if (this.bar) { // < --- this tab-line *should* be highlighted
    |       cb()
    |   }
    }
    

    Screenshot

    screen shot 2018-05-07 at 1 26 05 pm

  8. Tresky commented on May 8, 2018

    @Tresky

    alexandrudima Thank you for combining these together.

  9. 29 remaining items

  10. kanlukasz commented on Jul 16, 2019

    @kanlukasz

    I'm having trouble getting your plugin to work.. does it only work with certain langauges?

    Please, don't mix cases. This is VSCode repo, not Bracket Pair.
    If you have a problem with CoenraadS plugin, open ticket in his repository
    Keeping tickets clean is good for all of us ❤️


    I was going to perhaps take a stab at this, but is this an acceptable change? If so, can this be marked with help-wanted or bug?

    I hope it is possible/acceptable and VS Team will implement that.


    The Bracket Pair plugin is not a perfect solution because:

    • it does not recognize semantics in tags (html div, etc.)
    • it has a lot of problems with Extension causes high cpu load

    Another screen from N++
    obraz

  11. jabacchetta commented on Sep 10, 2019

    @jabacchetta

    This, in combination with #58713, provides for some unintuitive code navigation.

    FYI, for anyone looking to solve this issue with Bracket Pair Colorizer without getting all of the distracting colors shown in the screenshots, the following settings work well:

    {
      // Disable distracting bracket pair colors (prefer styling of Subtle Bracket matching pairs)
      "bracket-pair-colorizer-2.colors": [],
    
      // Customizes indent guide and scope line. Modify style to fit your theme. This works well with
      // Material Theme.
      "bracket-pair-colorizer-2.scopeLineCSS": [
        "borderStyle : solid",
        "borderWidth : 1px",
        "borderColor : #606d75",
        "opacity: 1"
      ],
    
      // // Set to false if wanting to remove the horizontal scope line that connects to the active indent
      // // guide.
      // "bracket-pair-colorizer-2.showHorizontalScopeLine": false,
    
      // Turn off built-in active indent guides since they aren't semantic (parent scope gets
      // highlighted in some scenarios).
      "editor.highlightActiveIndentGuide": false,
    }
  12. MatteCrystal commented on Sep 15, 2019

    @MatteCrystal

    I also think the current functionally in vs code is unacceptable especially since there seems to be no fix for html ATM which is what I need it for. Please add this feature, this is a deal breaker for many people.

  13. wmertens commented on Sep 30, 2019

    @wmertens

    There's over 5000 open issues in this repo. It's not helpful to keep saying the feature is crucial for your particular workflow. Just add your 👍 on the parent comment, that is something the team can search on too.

    So if you came here to say "me too", please refrain from doing so, it is counterproductive.

  14. LadyCailin commented on Sep 30, 2019

    @LadyCailin
    Contributor

    I completed a pull request 2 months ago that mostly fixed this. Can I get some feedback on that?

  15. reneolivo commented on Dec 13, 2019

    @reneolivo

    I really hate this! I hope there was some way to configure it. Leaving a comment in hopes that this is fixed.

  16. kanlukasz commented on Mar 16, 2020

    @kanlukasz

    Wow. Did I miss something, or the VS Team did something with this?
    At the moment I tested it and it looks as it working as we expect (more or less)

    indent

  17. quicksnap commented on Mar 16, 2020

    @quicksnap

    Woah! What?! You're right kanlukasz it's fixed now!

  18. LadyCailin commented on Mar 16, 2020

    @LadyCailin
    Contributor

    Yep! This is 90% fixed now with this PR: #77762 This bug still isn't closed, because the PR doesn't actually do semantic detection (it's just based on the indentation of the above and below lines) so there will still be edge cases where it doesn't work, but for the vast majority of cases and codebases, it will work just fine. See the PR for details about what cases it won't work in.

  19. mrjones2014 commented on Mar 18, 2020

    @mrjones2014

    LadyCailin I've been watching this issue for almost 2 years. you are my hero!

  20. hediet commented on Oct 15, 2021

    @hediet
    Member

    The issue shown in the screenshot has been fixed for indentation guides.

    For the remaining cases, we now have "Bracket Pair Guides", which are exact:

    recording

    In contrast to indentation guides, bracket pair guides use bracket pairs as ground truth (independend of any indentation).

  21. locked and limited conversation to collaborators on Nov 30, 2021
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

    editor-indent-guidesfeature-request

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions