Open wenkokke opened 10 months ago
Hey @wenkokke @tek Have you guys done any fixes for this issue?
@Nisarg1112 partially, in #120, but there's some work to be done before merging that PR and some follow-up work for fine-tuning comments.
@tek Any estimate by when that can be fully done and get merged?
@Nisarg1112 optimistically I would say two weeks, but if you're a dependent library author you can help speed up the process by giving feedback on discourse π
Hello @tek,
I also faced the same problem when parsing a function with a where clause. Tree-sitter Haskell groups comments into the function. Have you fixed this issue? If not, is there a temporary solution or workaround until it is resolved?
@sakthii25 Maybe you can traverse back the tree-sitter nodes and use regex to identify the comment blocks at the end of the function and then create a new tree?
@sakthii25 Maybe you can traverse back the tree-sitter nodes and use regex to identify the comment blocks at the end of the function and then create a new tree?
For now, Iβm just using the comment from the last node's function, as you suggested. However, I donβt think this is an ideal solution. Is there any other approach to resolve this issue, or do you know when it might be fixed
Yes, I agree that it's not ideal solution rather it's just a work-around. Unfortunately, I don't have visibility over when this would be fixed
if this is still broken you're likely using a pre-#120 version. If that's not the case, please post some example code
the version of tree-sitter is Version: 0.21.3 the version of tree-sitter-languages is Version: 1.10.2 i use python are you asking about these versions @tek ?
According to https://pypi.org/project/tree-sitter-languages/, the latest release is from February, so it definitely won't contain the fix for this
When parsing a function with a where-clause, tree-sitter-haskell groups comments after the where-clause into the decls node, rather than making them top-level comment nodes. For instance, the following code:
Parses to the following tree: