Detailed changes
@@ -36,6 +36,7 @@ pub struct FileDiffView {
const RECALCULATE_DIFF_DEBOUNCE: Duration = Duration::from_millis(250);
impl FileDiffView {
+ #[ztracing::instrument(skip_all)]
pub fn open(
old_path: PathBuf,
new_path: PathBuf,
@@ -162,6 +163,7 @@ impl FileDiffView {
}
}
+#[ztracing::instrument(skip_all)]
async fn build_buffer_diff(
old_buffer: &Entity<Buffer>,
new_buffer: &Entity<Buffer>,
@@ -1158,6 +1158,7 @@ impl Buffer {
}
}
+ #[ztracing::instrument(skip_all)]
pub fn build_snapshot(
text: Rope,
language: Option<Arc<Language>>,
@@ -1300,6 +1301,7 @@ impl Buffer {
})
}
+ #[ztracing::instrument(skip_all)]
pub fn preview_edits(
&self,
edits: Arc<[(Range<Anchor>, Arc<str>)]>,
@@ -97,6 +97,7 @@ pub use tree_sitter::{Node, Parser, Tree, TreeCursor};
static QUERY_CURSORS: Mutex<Vec<QueryCursor>> = Mutex::new(vec![]);
static PARSERS: Mutex<Vec<Parser>> = Mutex::new(vec![]);
+#[ztracing::instrument(skip_all)]
pub fn with_parser<F, R>(func: F) -> R
where
F: FnOnce(&mut Parser) -> R,
@@ -741,6 +741,7 @@ impl LanguageRegistry {
self.language_for_file_internal(path, None, None)
}
+ #[ztracing::instrument(skip_all)]
pub fn load_language_for_file_path<'a>(
self: &Arc<Self>,
path: &'a Path,
@@ -416,6 +416,7 @@ impl SyntaxSnapshot {
self.layers = layers;
}
+ #[ztracing::instrument(skip_all)]
pub fn reparse(
&mut self,
text: &BufferSnapshot,
@@ -425,6 +426,7 @@ impl SyntaxSnapshot {
self.reparse_(text, registry, root_language, None).ok();
}
+ #[ztracing::instrument(skip_all)]
pub fn reparse_with_timeout(
&mut self,
text: &BufferSnapshot,
@@ -4,13 +4,17 @@ pub use tracing::{Level, field};
pub use tracing::{
Span, debug_span, error_span, event, info_span, instrument, span, trace_span, warn_span,
};
+
#[cfg(not(ztracing))]
pub use ztracing_macro::instrument;
+#[cfg(ztracing)]
+const MAX_CALLSTACK_DEPTH: u16 = 16;
+
#[cfg(all(ztracing, ztracing_with_memory))]
#[global_allocator]
static GLOBAL: tracy_client::ProfiledAllocator<std::alloc::System> =
- tracy_client::ProfiledAllocator::new(std::alloc::System, 100);
+ tracy_client::ProfiledAllocator::new(std::alloc::System, MAX_CALLSTACK_DEPTH);
#[cfg(not(ztracing))]
pub use __consume_all_tokens as trace_span;
@@ -67,7 +71,7 @@ pub fn init() {
}
fn stack_depth(&self, _: &tracing::Metadata) -> u16 {
- 8
+ MAX_CALLSTACK_DEPTH
}
fn format_fields_in_zone_name(&self) -> bool {