You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The scopes for textDocument/documentHighlight regions can be configured via the "document_highlight_scopes" setting.
It would be nice to have more specific default scopes here, such that color scheme authors can easily provide a better, customized style for them. My suggestion would be
These scopes are fully backwards compatible for color schemes which don't target markup.highlight (probably all existing color schemes). I saw that @rwols suggested markup.related.read and markup.related.write in sublimehq/Packages#1036 (comment), which could be an alternative, but I think I would prefer markup.highlight, because documentHighlight is the corresponding request name.
(Also VS Code themes have direct color settings for them (instead of Textmate scopes), which are named "editor.wordHighlight[...]" for DocumentHighlightKind.Read and "editor.wordHighlightStrong[...]" for DocumentHighlightKind.Write.)
If the scopes get documented well and ideally mentioned in an update message for the next release, this setting could even be removed completely, because users could then use a color scheme customization for these scopes, instead of changing the scope names in the settings.
Besides that, I would suggest to drop the "unknown" setting, and fall back to "text" if the DocumentHighlightKind is omitted, because there is no "unknown" kind in the specs, and Text is the default kind:
exportinterfaceDocumentHighlight{/** * The range this highlight applies to. */range: Range;/** * The highlight kind, default is DocumentHighlightKind.Text. */kind?: DocumentHighlightKind;}/** * A document highlight kind. */exportnamespaceDocumentHighlightKind{/** * A textual occurrence. */exportconstText=1;/** * Read-access of a symbol, like reading a variable. */exportconstRead=2;/** * Write-access of a symbol, like writing to a variable. */exportconstWrite=3;}
I.e. this kind value doesn't exist in the specs and the fallback value here should be DocumentHighlightKind.Text.
What do you think about 1./2./3.?
The text was updated successfully, but these errors were encountered:
Here is an example how this allows subtle background styling with a single rule for markup.highlight with foreground & background color in my color scheme and "document_highlight_style" set to "fill". Unfortunately Sublime's add_regions obtains the underline/outline color also from "background", so color scheme authors need to decide if they want a nice style either for "fill", or for the other options.
The scopes for textDocument/documentHighlight regions can be configured via the
"document_highlight_scopes"
setting.These scopes are fully backwards compatible for color schemes which don't target
markup.highlight
(probably all existing color schemes). I saw that @rwols suggestedmarkup.related.read
andmarkup.related.write
in sublimehq/Packages#1036 (comment), which could be an alternative, but I think I would prefermarkup.highlight
, because documentHighlight is the corresponding request name.(Also VS Code themes have direct color settings for them (instead of Textmate scopes), which are named "editor.wordHighlight[...]" for
DocumentHighlightKind.Read
and "editor.wordHighlightStrong[...]" forDocumentHighlightKind.Write
.)If the scopes get documented well and ideally mentioned in an update message for the next release, this setting could even be removed completely, because users could then use a color scheme customization for these scopes, instead of changing the scope names in the settings.
Besides that, I would suggest to drop the
"unknown"
setting, and fall back to"text"
if the DocumentHighlightKind is omitted, because there is no "unknown" kind in the specs, andText
is the default kind:I.e. this kind value doesn't exist in the specs and the fallback value here should be
DocumentHighlightKind.Text
.What do you think about 1./2./3.?
The text was updated successfully, but these errors were encountered: