-
Notifications
You must be signed in to change notification settings - Fork 20
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
public API overhaul #647
public API overhaul #647
Changes from all commits
10b07a4
27908fd
109a23d
20ad567
234e521
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@nomicfoundation/slang": minor | ||
--- | ||
|
||
Require specifying an initial offset when creating a CST cursor. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -93,7 +93,7 @@ impl Match { | |
pub fn is_full_recursive(&self) -> bool { | ||
self.nodes | ||
.iter() | ||
.flat_map(cst::Node::cursor) | ||
.flat_map(|node| cst::Node::create_cursor(node, Default::default())) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not a fan of using the Default as parameter and think it'd be clearer if we have a separate This is fine for now, but I'd rethink how we can design the API to better convey that only the root node cursor has absolute offsets and other created ones are relative. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think Also I thought about introducing a But I think we should consider this as part of future updates to the API. I want to keep this PR minimal to address existing feedback. |
||
.all(|node| node.as_token_with_kind(&[TokenKind::SKIPPED]).is_none()) | ||
} | ||
} | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If exposing the API is important for us now, I would add more documentation to the public cursor functions that the user might use
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure!