-
Notifications
You must be signed in to change notification settings - Fork 15
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
Custom statement_range()
LSP message
#85
Conversation
#[macro_export] | ||
macro_rules! backend_trace { |
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.
Does it seem reasonable to do this? Is there anything else I need to do besides this tag?
// TODO: Uncommenting this causes a compile error??? | ||
// backend_trace!(self, "statement_range(): No child associated with point."); |
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.
@kevinushey I think we should talk about this and see if the backend_trace!()
macro has a bug in it somehow
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.
It seems to work above; maybe the macro doesn't handle invocations lacking any arguments?
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.
Or perhaps it's because logging here requires a call to .await
and that doesn't play nicely when you have treesitter nodes on the stack?
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.
It has something to do with the latter. If i put the message before the creation of root
then everything is fine
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.
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.
That thing gives C++ template compilation errors a run for its money 💀
We could probably adjust the macro to either avoid the await, or spawn a separate execution context wherein it could be awaited safely and independently from the current call... not sure if you have any strong feelings.
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.
Definitely no strong feelings
statement_range()
implementationstatement_range()
LSP message
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.
LGTM!
Joint with posit-dev/positron#1227 - see there for full details
goto_first_child_for_point()
doesn't work as expected, see tree-sitter/tree-sitter#2012, so I'm using a Rust implementation of the patch they used in Emacs tree-sitter/tree-sitter#2012 (comment)