rust: Add Language::node_kind_is_visible API
This commit is contained in:
parent
ee7c29346a
commit
a1c3de1b99
1 changed files with 6 additions and 0 deletions
|
|
@ -200,6 +200,12 @@ impl Language {
|
|||
unsafe { ffi::ts_language_symbol_type(self.0, id) == ffi::TSSymbolType_TSSymbolTypeRegular }
|
||||
}
|
||||
|
||||
pub fn node_kind_is_visible(&self, id: u16) -> bool {
|
||||
unsafe {
|
||||
ffi::ts_language_symbol_type(self.0, id) <= ffi::TSSymbolType_TSSymbolTypeAnonymous
|
||||
}
|
||||
}
|
||||
|
||||
/// Get the number of distinct field names in this language.
|
||||
pub fn field_count(&self) -> usize {
|
||||
unsafe { ffi::ts_language_field_count(self.0) as usize }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue