Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customizing style of diagnostics with tags no longer works in dev builds #2253

Closed
rchl opened this issue May 13, 2023 · 2 comments · Fixed by #2254
Closed

Customizing style of diagnostics with tags no longer works in dev builds #2253

rchl opened this issue May 13, 2023 · 2 comments · Fixed by #2254

Comments

@rchl
Copy link
Member

rchl commented May 13, 2023

Describe the bug

This approach:

LSP/plugin/session_view.py

Lines 298 to 299 in b49da9e

if tag_scope and 'background' in self.view.style_for_scope(tag_scope):
self.view.add_regions(key_tags[tag], regions, tag_scope, flags=sublime.DRAW_NO_OUTLINE)

no longer works in current ST dev builds due to this "issue": sublimehq/sublime_text#5942

I don't remember if there is a reason that we are not adding regions if custom color scheme rule is not defined...
Is it just a minor optimization and it would be fine to always do it? @jwortmann ?

@rchl rchl changed the title Customizing style of diagnostics with tags no longer functions in new dev builds Customizing style of diagnostics with tags no longer works in dev builds May 13, 2023
@jwortmann
Copy link
Member

I would say this is a non-issue, and everything works as expected :)

We even have an explicit warning about this in the docs:

The color scheme rule only works if the "background" color is different from the global background of the scheme.

You could simply fix the preceding code block example, to follow this advice, for example similar to the code block example in the "Semantic Highlighting" section. That one should work unless the color scheme's background is #000001.

I think the reason to not add it if there's no color scheme rule was only a performance optimization, but I assume if the check for "background" doesn't apply, to add the region would have no effect anyway (?). And another disadvantage of adding the region is, that it removes font_style, though I haven't checked whether this also applies if there's no relevant color scheme rule for it.

@rchl
Copy link
Member Author

rchl commented May 13, 2023

Why nobody told me earlier? ;)

but I assume if the check for "background" doesn't apply, to add the region would have no effect anyway (?)

Actually it would create this issue so we can't do that:

Screenshot 2023-05-13 at 16 15 55

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants