language: Do not fetch diagnostics when iterating over text without language awareness (#16824)
This PR fixes a regression from https://github.com/zed-industries/zed/pull/15646 where we've started fetching diagnostic spans unconditionally (whereas previously that wasn't done when iterating over raw text). Closes #16764 Release Notes: - Fixed performance regression in handling buffers with large quantities of diagnostics.
This commit is contained in:
parent
14f8d3a33a
commit
5e55d5507f
2 changed files with 40 additions and 30 deletions
|
@ -1358,7 +1358,9 @@ impl Language {
|
|||
});
|
||||
let highlight_maps = vec![grammar.highlight_map()];
|
||||
let mut offset = 0;
|
||||
for chunk in BufferChunks::new(text, range, Some((captures, highlight_maps)), None) {
|
||||
for chunk in
|
||||
BufferChunks::new(text, range, Some((captures, highlight_maps)), false, None)
|
||||
{
|
||||
let end_offset = offset + chunk.text.len();
|
||||
if let Some(highlight_id) = chunk.syntax_highlight_id {
|
||||
if !highlight_id.is_default() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue