digitallyserviced / semanticolor

Provide Atom editor with semantic color highlighting.
https://atom.io/packages/semanticolor
MIT License
34 stars 3 forks source link

Does not properly collapse sequential code blocks when opening bracket of second is on same line as closing of first #34

Closed christopherjbaker closed 4 years ago

christopherjbaker commented 5 years ago

This has been bugging me for a while, so I decided to open an issue.

When viewing code where a sequential block starts on the same line as the previous ends, such as an if-else (see first image), collapsing the first block also removes the ability to collapse subsequent blocks (see second image). When using the built-in javascript language this is not an issue (see third image). image image image

The built in language only supports this if tree-sitters are enabled, so I assume it is being held up by your http://atom/atom#19151, but I wanted to point out another issue with the lack of tree-sitter support.

sharedprophet commented 5 years ago

Thanks.

christopherjbaker commented 4 years ago

I understand why the other issue has been closed (though sadly) as it is not language agnostic. I do not understand why this is being closed, however. This is an objective bug in how these languages compare to others.

sharedprophet commented 4 years ago

As you said, it will be fixed when tree-sitter support is possible (atom/atom#19151). Hopefully that will be soon? I have created a branch of Atom which would enable it and a branch on here that is ready to merge if they do pull in my suggestion. Until then, there's not much I can do about this.

christopherjbaker commented 4 years ago

oh ok. Without comment, it looked like it was "closed because not gonna happen", but its more "closed because we can't until this other thing". That's fair. I did start following that other issue too. Is there anything I can do over there to encourage them to support this?

sharedprophet commented 4 years ago

Not that I know of. I just proposed the working solution earlier today, so let's give them a chance to look at it before we bug them too much. : )

christopherjbaker commented 4 years ago

Is that a 100% solution? I saw that some of your previous ones were only close.

sharedprophet commented 4 years ago

Yes, I got it working really well with that solution, and it should avoid the performance hit Max Brunsfeld was concerned about.