Remove theme parameters from buffer/display map's chunks methods

Change Chunks to contain highlight ids instead of actual highlight
styles. Retrieve the actual highlight style from the theme in the
editor element layer.

This is to set us up to perform syntax highlighting in other code
paths where the theme is not available.
This commit is contained in:
Max Brunsfeld 2022-02-02 16:33:04 -08:00
parent 101add8da3
commit 88adddb324
11 changed files with 141 additions and 168 deletions

View file

@ -1090,7 +1090,7 @@ fn chunks_with_diagnostics<T: ToOffset + ToPoint>(
range: Range<T>,
) -> Vec<(String, Option<DiagnosticSeverity>)> {
let mut chunks: Vec<(String, Option<DiagnosticSeverity>)> = Vec::new();
for chunk in buffer.snapshot().chunks(range, Some(&Default::default())) {
for chunk in buffer.snapshot().chunks(range) {
if chunks
.last()
.map_or(false, |prev_chunk| prev_chunk.1 == chunk.diagnostic)