sublimehq / sublime_text

Issue tracker for Sublime Text
https://www.sublimetext.com
809 stars 39 forks source link

Syntax Highlighting bug in 4166 #6207

Closed atstockland closed 11 months ago

atstockland commented 11 months ago

Description of the bug

The syntax highlighter is now tricked by some rails code. A method defined with certain arguments will cause the highlighter to not work.

Steps to reproduce

create the following method:

def initialize(user, company_id) @user = user @company_id = company_id end

If you click on "def", "end" will be correctly highlighted. Now change the method to use a default on company_id:

def initialize(user, company_id = nil) @user = user @company_id = company_id end

When you click on "def"...the closing "end" is not correctly highlighted.

Expected behavior

The syntax highlighter should highlight the closing block even when argument defaults are provided.

Actual behavior

The syntax highlighter is somehow tricked when argument default is defined...and, does not highlight the closing end.

Sublime Text build number

4166

Operating system & version

MacOs 14.2

(Linux) Desktop environment and/or window manager

No response

Additional information

Ruby on Rails 7.1.2

OpenGL context information

No response

BenjaminSchaaf commented 11 months ago

If you click on "def", "end" will be correctly highlighted.

This functionality is being provided by a third party package, not Sublime Text. I suggest filing an issue on that package's repository.

atstockland commented 11 months ago

Doesn't ST have syntax highlighting baked in now? I'm not aware of any package I have installed that offers syntax highlighting. Unless it's part of my theme.

Thanks. I'll look elsewhere.

BenjaminSchaaf commented 11 months ago

Syntax highlighting is baked in, but clicking on def and it highlighting end is not syntax highlighting. ST does do bracket matching where it highlights bracket pairs but it doesn't do so for keywords in ruby. You can confirm this by downgrading to the previous version and running it in safe mode (ie. without plugins).

atstockland commented 11 months ago

Oh my gosh. What a brain fart. Sorry for that.

themilkman commented 11 months ago

@atstockland: Could be https://packagecontrol.io/packages/BracketHighlighter / https://github.com/facelessuser/BracketHighlighter I guess? At least I can reproduce what you write with it (if I am not on the wrong track, too)