After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 756699 - Wrong highlighting of Python keywords using the themes 'Builder' or 'Builder Dark'
Wrong highlighting of Python keywords using the themes 'Builder' or 'Builder ...
Status: RESOLVED FIXED
Product: gnome-builder
Classification: Other
Component: editor
3.18.x
Other Linux
: Normal normal
: ---
Assigned To: GNOME Builder Maintainers
GNOME Builder Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-10-16 14:08 UTC by Tobias Schönberg
Modified: 2017-06-04 22:46 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
screencast showing the bug appear after a 2nd parsing (1.12 MB, video/x-matroska)
2015-10-16 14:08 UTC, Tobias Schönberg
  Details
ctags: lower the tags priorities (1021 bytes, patch)
2017-06-04 16:55 UTC, sébastien lafargue
committed Details | Review

Description Tobias Schönberg 2015-10-16 14:08:15 UTC
Created attachment 313467 [details]
screencast showing the bug appear after a 2nd parsing

Certain Python-keywords are highlighted with the wrong color when using the highlighting-themes 'Builder' or 'Builder Dark'. For example "if" is highlighted blue like a function instead of white like a keyword. Or "from" is highlighted blue instead of dark pink. But it depends on the file which keywords fail to highlight correctly.

When opening large Python files (+5k lines) the parsing gets slow enough that one can see that initially the keywords are highlighted correctly, and then switch to the wrong highlighting in a 2nd highlight parsing (See attached screencast).
Comment 1 Christian Hergert 2015-10-16 15:55:41 UTC
This is because of Ctags highlighting. Ctags doesn't give us quite enough context to highlight correctly for all the languages. It's basically "dumb" right now and just highlights by matching words to the index.
Comment 2 Tobias Schönberg 2017-06-04 13:21:06 UTC
Same things happen in CSS files when the keywords are separated by a dash and the words are found somewhere in the project.

Example:

.test-footer {
  font-size: 20px;
}

And either test or footer is found and highlighted differently from a CSS class.
Comment 3 sébastien lafargue 2017-06-04 16:50:52 UTC
Part of the problem, if not all, can be fixed by lowering the ctags tag priority so that we never overwrite the GtkSourceView ones.
Comment 4 sébastien lafargue 2017-06-04 16:55:09 UTC
Created attachment 353151 [details] [review]
ctags: lower the tags priorities

The ctags highlight tags should not overwrite
the ones set by GtkSourceView.
Comment 5 Christian Hergert 2017-06-04 20:51:11 UTC
Review of attachment 353151 [details] [review]:

Sure, LGTM
Comment 6 sébastien lafargue 2017-06-04 20:55:31 UTC
Comment on attachment 353151 [details] [review]
ctags: lower the tags priorities

Attachment 353151 [details] pushed as 789d72f - ctags: lower the tags priorities
Comment 7 sébastien lafargue 2017-06-04 20:57:50 UTC
Tobias, it's pushed to master.

Can you try either with jhbuild or flatpak once it hit the nightly
if there's others cases encountered.

If some, can you attach a simple reproducible case here ?

In the meantime, i let the bug report open
Comment 8 Tobias Schönberg 2017-06-04 22:46:39 UTC
Tried the flatpak. Looks perfect now. Thanks very much!