Convert query capture indices to style ids

* Introduce a Theme struct as a new part of the app's settings
* Store on each Language a ThemeMap, which converts the capture ids
  from that language's highlight query into StyleIds, which identify
  styles in the current Theme.
* Update `highlighted_chunks` methods to provide StyleIds instead of
  capture ids.
This commit is contained in:
Max Brunsfeld
2021-05-24 16:44:14 -07:00
parent bc8d2b2f1d
commit 8340958b33
11 changed files with 389 additions and 26 deletions
Generated
+11 -1
View File
@@ -347,7 +347,7 @@ dependencies = [
"tar",
"target_build_utils",
"term",
"toml",
"toml 0.4.10",
"uuid",
"walkdir",
]
@@ -2702,6 +2702,15 @@ dependencies = [
"serde 1.0.125",
]
[[package]]
name = "toml"
version = "0.5.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa"
dependencies = [
"serde 1.0.125",
]
[[package]]
name = "tree-sitter"
version = "0.19.5"
@@ -2996,6 +3005,7 @@ dependencies = [
"smallvec",
"smol",
"tempdir",
"toml 0.5.8",
"tree-sitter",
"tree-sitter-rust",
"unindent",