Fix performance issues in project search related to detecting JSX tag auto-closing (#30842)
This PR changes it so we only create a snapshot and get the syntax tree for a buffer if we didn't detect that auto_close is enabled. <img width="1205" alt="Screenshot 2025-05-16 at 21 10 28" src="https://github.com/user-attachments/assets/1ada445f-77bc-4c7c-bffe-953f34ee5384" /> Release Notes: - Improved project search performance
This commit is contained in:
parent
16366cf9f2
commit
a824119367
1 changed files with 4 additions and 0 deletions
|
@ -316,6 +316,10 @@ pub(crate) fn refresh_enabled_in_any_buffer(
|
||||||
let multi_buffer = multi_buffer.read(cx);
|
let multi_buffer = multi_buffer.read(cx);
|
||||||
let mut found_enabled = false;
|
let mut found_enabled = false;
|
||||||
multi_buffer.for_each_buffer(|buffer| {
|
multi_buffer.for_each_buffer(|buffer| {
|
||||||
|
if found_enabled {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
let buffer = buffer.read(cx);
|
let buffer = buffer.read(cx);
|
||||||
let snapshot = buffer.snapshot();
|
let snapshot = buffer.snapshot();
|
||||||
for syntax_layer in snapshot.syntax_layers() {
|
for syntax_layer in snapshot.syntax_layers() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue