Sublime Forum

Python multiline docstrings treated as comments in build 3114

#1

Hello.

I’ve installed the new version (build 3114) on Linux Mint today and noticed, that python docstrings (double quoted strings / multiline strings) are shown as comments (gray, italic font).

I don’t like it and I would like to turn it back to old look of strings. I’ve tried to change it in Python.tmLanguage and .tmTheme, but no luck.

Screenshot: https://dl.dropboxusercontent.com/u/11891854/tmp/Screens/quotes.png

0 Likes

#2

You would need to copy the latest Python.sublime-syntax, and customize it in Packages/Python/. However such as override will require you to port fixes as they are made.

0 Likes

#3

I don’t want to be pain in the ass, but why did you changed the color of something, that takes so much space in python programs? After two and half years of looking into the green text, I really don’t want to teach my brain new tricks. I am just curious about the reasoning behind this.

I’ve „solved“ the problem by copying https://raw.githubusercontent.com/sublimehq/Packages/5cdaac68ca4f49fd208443aa4f118240958a97b3/Python/Python.sublime-syntax to Packages/Python/ as you suggested.

0 Likes

#4

It used to be that way in the original tmLanguage, I just “fixed” it while fixing other bugs.

Unfortunately the original syntax files from TextMate had plenty of bugs. We’ve been working on fixing them and making the scope names more consistent for better color scheme support. The downside is that many users have gotten use to the “feel” of the current bugs and errors in scopes. I understand that reaction, however making scopes correct (and thus fixing indexer and other functional issues), feels like the right call. Especially as weed need to add support for new language features as they are released.

0 Likes

#5

Could’t there be some setting to allow users to switch between the two modes?

0 Likes

#6

I’m away from the computer for a while, but the ideal solution is to ensure there is a scope on docstrings that distinguishes them from other comments, then you just tweak your color scheme to highlight it the way you want. I don’t recall if such a scope exists right now.

Unfortunately syntax files can not be affected by settings.

0 Likes

#7

After fighting off brush fires and other coding nightmares, having Sublime Text update to the newest build and ghost my comments into gray is like having discovered a turd in the punch bowl after drinking several cups.

It’s not terribly upsetting but disappointing. While everyone has an explanation or justification why, I can’t help but feel like it’s more of an “up yours” than not.

Perhaps I’m just accustomed to the look and feel remaining consistent. And perhaps it was taxing enough to change every single one of the multiline SQL queries to use double quotes instead of single quotes because the syntax highlighter had an issue. All I can say is that it’s a disappointing surprise to an already disappointing day.

0 Likes

#8

I just had a quick check, and they don’t have a unique scope atm: source.python comment.block.python but it should be easy enough to add - I will make a PR when I get time to look at it if someone else doesn’t beat me to it :slight_smile:

0 Likes

#9

I have made a PR which will assign a meta scope for color schemes to target :slight_smile:

1 Like

#10

Well, there are no other forms of block comments in Python, so comment.block.python is sufficiently unique already as a selector.

0 Likes