Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: expose nodeIsMissing getter #96

Merged

Conversation

char0n
Copy link
Contributor

@char0n char0n commented Nov 28, 2021

During my research into tree-sitter CST traversal, I found out that Node.js tree-sitter binding doesn't contain cached getter nodeIsMissing. Because of that, when using TreeCursor, the only way to determine if the SyntaxNode is missing is to call the cursor.currentNode.isMissing() method. By doing this, traversal performance goes out the window. web-binding for tree-sitter exposes nodeIsMissing cached field, but Node.js binding doesn't. This PR remedies the situation.

Before:

cursor = tree.walk();
cursor.currentNode.isMissing();

After:

cursor = tree.walk();
cursor.nodeIsMissing;

Refs tree-sitter/tree-sitter#1469

Signed-off-by: Vladimir Gorej vladimir.gorej@gmail.com

@char0n char0n force-pushed the char0n/expose-isNodeMissing-getter branch 2 times, most recently from 2b2a188 to 5cb8130 Compare November 28, 2021 19:51
Refs tree-sitter/tree-sitter#1469

Signed-off-by: Vladimir Gorej <vladimir.gorej@gmail.com>
@char0n char0n force-pushed the char0n/expose-isNodeMissing-getter branch from 5cb8130 to 9eb780e Compare November 28, 2021 20:04
@char0n
Copy link
Contributor Author

char0n commented Nov 28, 2021

Tests are failing on x86 Platform, but pass on x64. Have no idea why thought.

@char0n
Copy link
Contributor Author

char0n commented Jan 11, 2022

@maxbrunsfeld just pinging here

@char0n
Copy link
Contributor Author

char0n commented Jun 9, 2022

@maxbrunsfeld pinging again.

@char0n
Copy link
Contributor Author

char0n commented Oct 26, 2022

@maxbrunsfeld just pinging again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants