Merge #8795
8795: Allow semantic tokens for strings to be disabled r=matklad a=djrenren Fixes https://github.com/rust-analyzer/rust-analyzer/issues/7111 Pretty straightforward change, but open to any suggestions if there's a more recommended testing strategy than what I went with. Co-authored-by: John Renner <john@jrenner.net>
This commit is contained in:
@@ -208,6 +208,13 @@ config_data! {
|
||||
/// Advanced option, fully override the command rust-analyzer uses for
|
||||
/// formatting.
|
||||
rustfmt_overrideCommand: Option<Vec<String>> = "null",
|
||||
|
||||
/// Use semantic tokens for strings.
|
||||
///
|
||||
/// In some editors (e.g. vscode) semantic tokens override other highlighting grammars.
|
||||
/// By disabling semantic tokens for strings, other grammars can be used to highlight
|
||||
/// their contents.
|
||||
semanticStringTokens: bool = "true",
|
||||
}
|
||||
}
|
||||
|
||||
@@ -381,6 +388,9 @@ impl Config {
|
||||
pub fn line_folding_only(&self) -> bool {
|
||||
try_or!(self.caps.text_document.as_ref()?.folding_range.as_ref()?.line_folding_only?, false)
|
||||
}
|
||||
pub fn semantic_strings(&self) -> bool {
|
||||
self.data.semanticStringTokens
|
||||
}
|
||||
pub fn hierarchical_symbols(&self) -> bool {
|
||||
try_or!(
|
||||
self.caps
|
||||
|
||||
Reference in New Issue
Block a user