-
Notifications
You must be signed in to change notification settings - Fork 24
Use treesitter to get code language #187
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
Conversation
I forgot to delete a call to |
I fixed |
- Bring back parend_diff() and has_op().
This pull request is ready for review now. It:
|
Note: the tests fail to run correctly ( |
Also: bring back parend_diff() and has_op() to fix sending code to Rhelp.
Excellent, it simplifies the code a lot. Testing/reviewing it right now. |
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.
Looks good to me!
The documentation of
So, it seems that each time that |
Curious to see if it would make a significant difference. |
No difference in a quick test. |
This is faster than using treesitter (but more complicated): https://github.com/R-nvim/cmp-r/blob/main/lua/cmp_r/init.lua#L328-L396 We are talking about processes that take less than a millisecond, but it's good to know that it's faster to get a range of lines and call |
This is all good on my side. Ready to merge? |
Thank you! |
I really like these changes, code is simpler. |
This pull request replaces the
b:IsInRCode
functions with a single tree-sitter based function. It seems to work well with Rmarkdown or Quarto, but not with Rnoweb. We still need a specificis_in_R_code
function for therhelp
file type because there is no tree-sitter grammar for it.