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:
@@ -316,6 +316,10 @@ pub(crate) fn refresh_enabled_in_any_buffer(
|
||||
let multi_buffer = multi_buffer.read(cx);
|
||||
let mut found_enabled = false;
|
||||
multi_buffer.for_each_buffer(|buffer| {
|
||||
if found_enabled {
|
||||
return;
|
||||
}
|
||||
|
||||
let buffer = buffer.read(cx);
|
||||
let snapshot = buffer.snapshot();
|
||||
for syntax_layer in snapshot.syntax_layers() {
|
||||
|
||||
Reference in New Issue
Block a user