3 ms·
Another issue with tree-sitter is how basic functionality is not consistent across all languages. Want to find all comment text in all languages? Each tree-sitt
by gravypod 4y ago
Another issue with tree-sitter is how basic functionality is not consistent across all languages. Want to find all comment text in all languages? Each tree-sitter lang support will have a slightly different behavior for every language. When you extract the comment you'll have syntax from the language in there like `/*/` or `{}`.
Example from a sourcegraph docs generation project:
https://github.com/sourcegraph/doctree/blob/07a2d593fe9855be6a8928394abee72e2543fef9/doctree/indexer/zig/indexer.go#L360 https://github.com/sourcegraph/doctree/blob/07a2d593fe9855be...
https://github.com/sourcegraph/doctree/blob/07a2d593fe9855be6a8928394abee72e2543fef9/doctree/indexer/golang/indexer.go#L418 https://github.com/sourcegraph/doctree/blob/07a2d593fe9855be...