Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Highlight ruby debugger lines appropriately
Fixes #16357 The change expands the matching regex to only highlight lines where the debugger is the first word on a line. The intended behavior is to highlight lines that are calling a ruby debugger. The purpose is to warn developers that might push code to production with a debugger enabled. The change expands the matching regex to only highlight lines where the debugger is the first word on a line. However, there are cases in which the regex is highlighting lines as a false-positive. I first noticed this in my `Gemfile` when it was highlighting the line below: ```ruby gem 'pry-byebug' ``` Other cases include: commented lines and defined function names that match a known debugger. See below for cases in which the line should and should not be highlighted. ```ruby class Test # This line below should not be highlighted def byebug byebug # this line should be highlighted # byebug This comment shouldn't be highlighted binding.irb # this line should be highlighted # binding.irb this line should not be highlighted binding.pry # this line should be highlighted # binding.pry this line should not be highlighted end end ```
- Loading branch information