-
Notifications
You must be signed in to change notification settings - Fork 3
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
Code folding broken #5
Comments
Thank you for your work on jtsx and for looking into my fork! I'm currently working on folding and backward/forward list functions behaviour, and I plan to do further manual testing and debugging on a few private TypeScript/JavaScript/React projects. The aim is to create a PR for this within the next few days, although this timeline might extend if I encounter some more issues. |
Sounds great ! Thank you for contributing to this package. |
I used I haven’t tried it yet with I use code folding extensively in my workflow, therefore, I had to look into Subj. issue. I had to perform a few smerge calls to rebase my changes onto your latest master branch. I’m not 100% sure if the merges didn’t introduce any issues. I also haven’t found a good way to execute Could I ask you to clone it from my branch and run the tests on your side? Issues and concerns with this code-folding revision:
|
Many thanks for your work @ramblehead !
I rarely use graphql and css in js strings, but it would be great to be able to support it in some way. For css in js, I did a PR in tree-sitter-css-in-js few weeks ago to try to make it usable with I didn't know about the existence of
I need to work on making the test suite easier to use for contributors... I just have completed the integration of Eask for that purpose, but it is not yet on the To run
As far I know it is working in this repo (https://github.com/llemaitre19/jtsx/actions). But on your fork I see no workflow has run, I cannot remember if there is something to do to enable workflows on a forked repository. Anyway, I have run the tests on my local machine, all tests have passed on
This small change makes the test succeed:
It confirms that the bug |
The PR has your suggested fix with Emacs version ">=30" and I re-based it to your current master branch. The Pull Request includes your suggested fix for Emacs version “>=30”, and I have rebased it onto your current master branch. When I have some time, I’ll experiment with the Nix package manager in Guix. They seem to be compatible: https://guix.gnu.org/manual/en/html_node/Miscellaneous-Services.html#Nix-service |
Thank you for the comments and the thorough PR review! I am currently in a transition between jobs and away from any reasonable internet 😅 I will try to respond to your review next weekend. For now I can say that the funny looking regexp is due to valid JS blocks inside JSX prop values that allow "//" and "/**/" comments inside opening tag. Also, JSX props can be commented with "//". Therefore regexp that just excludes "/" symbol could not be used here. There are some other edge cases, such as XML in string or comments inside JS inside JSX. This is the reason of my concern with "blend of treesit and regexp approaches". |
I have merged your PR. You can see my comments inside it. Additional comments or minor changes could be done later. It let the code folding works again from now on (in master branch). I close this issue. Thank you again for giving some of your time to contribute to this package @ramblehead . |
The commit 2b50a2e should address these 3 points. |
After some debugging, it appears that code folding does not work anymore for 2 reasons:
jtsx-hs-find-block-beginning
should return the new position instead ofnil
(bug probably introduced by commit 6a717e2).hs-looking-at-block-start-p
does not work anymore out of the box for JSX blocks, it needs to be customized.@ramblehead , your fork seems to exactly address these issues. If you are planning to send a PR soon, please let me know. Thanks !
The text was updated successfully, but these errors were encountered: