Mark hotspots + add some logs

This commit is contained in:
Jakub Konka
2025-11-20 18:20:21 +01:00
parent 408887eeed
commit 285965ffa8
2 changed files with 3 additions and 0 deletions

View File

@@ -1574,8 +1574,10 @@ impl Buffer {
self.did_finish_parsing(new_syntax_snapshot, cx);
self.reparse = None;
}
// TODO JK hotspot
Err(parse_task) => {
// todo(lw): hot foreground spawn
log::error!("Oops, we failed in bg, so let's try fg instead");
self.reparse = Some(cx.spawn(async move |this, cx| {
let new_syntax_map = cx.background_spawn(parse_task).await;
this.update(cx, move |this, cx| {

View File

@@ -1306,6 +1306,7 @@ fn parse_text(
parser.set_included_ranges(ranges)?;
parser.set_language(&grammar.ts_language)?;
parser
// TODO JK hotspot
.parse_with_options(
&mut move |offset, _| {
chunks.seek(start_byte + offset);