Add errors_present field to tagging context.

This commit is contained in:
Patrick Thomson 2020-08-04 17:53:47 -04:00
parent af655547e5
commit 1a571ae208

View file

@ -52,6 +52,7 @@ pub struct TSTagsBuffer {
context: TagsContext,
tags: Vec<TSTag>,
docs: Vec<u8>,
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,