From 1a571ae20877c7bfac1fa59f0cc38027fe669685 Mon Sep 17 00:00:00 2001 From: Patrick Thomson Date: Tue, 4 Aug 2020 17:53:47 -0400 Subject: [PATCH] Add errors_present field to tagging context. --- tags/src/c_lib.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tags/src/c_lib.rs b/tags/src/c_lib.rs index 07e1e19a..b93c69a2 100644 --- a/tags/src/c_lib.rs +++ b/tags/src/c_lib.rs @@ -52,6 +52,7 @@ pub struct TSTagsBuffer { context: TagsContext, tags: Vec, docs: Vec, + errors_present: bool, } #[no_mangle] @@ -184,6 +185,7 @@ pub extern "C" fn ts_tags_buffer_new() -> *mut TSTagsBuffer { context: TagsContext::new(), tags: Vec::with_capacity(64), docs: Vec::with_capacity(64), + errors_present: false, })) } @@ -216,6 +218,12 @@ pub extern "C" fn ts_tags_buffer_docs_len(this: *const TSTagsBuffer) -> u32 { buffer.docs.len() as u32 } +#[no_mangle] +pub extern "C" fn ts_tagger_errors_present(this: *const TSTagsBuffer) -> bool { + let buffer = unwrap_ptr(this); + buffer.errors_present +} + #[no_mangle] pub extern "C" fn ts_tagger_syntax_kinds_for_scope_name( this: *mut TSTagger,