From a1c3de1b9976cd20ebd158d05ad630f794df2490 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Fri, 31 Jan 2020 12:04:18 -0800 Subject: [PATCH] rust: Add Language::node_kind_is_visible API --- lib/binding_rust/lib.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/binding_rust/lib.rs b/lib/binding_rust/lib.rs index daa3b45b..a693b24f 100644 --- a/lib/binding_rust/lib.rs +++ b/lib/binding_rust/lib.rs @@ -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 }