Skip to content

Commit fbfed4e

Browse files
committed
feat(ast_grep): add id method to SgNodeRjs for node identification
1 parent 2ca5c73 commit fbfed4e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

crates/codemod-sandbox/src/ast_grep/sg_node.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,10 @@ impl<'js> SgNodeRjs<'js> {
166166
Ok(result)
167167
}
168168

169+
pub fn id(&self) -> Result<usize> {
170+
Ok(self.inner_node.node_id())
171+
}
172+
169173
#[qjs(rename = "isLeaf")]
170174
pub fn is_leaf(&self) -> Result<bool> {
171175
Ok(self.inner_node.is_leaf())

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy