Replies: 3 comments 6 replies
-
@ahelwer Do you have a rough estimate of how difficult or time-consuming it would be to add recovery parsing to SANY? Incremental parsing is less of a priority—partly because we already have some support for it (TLA+ debugger breakpoint expressions). |
Beta Was this translation helpful? Give feedback.
-
|
I'm biased (since it's the reason I developed tree-sitter-tlaplus in the first place) but the purpose of tree-sitter as a project is to replace all instances of using regular expressions to parse context-free or context-sensitive languages, a very obvious category error. With regard to inconsistencies between SANY and tree-sitter-tlaplus, both of them conform to the syntactic test corpus (modulo a few open bugs) so we can be basically assured no user-visible differences exist. There are other nice features of the tree-sitter API, like being able to run queries for particular syntax subtree forms. Issue microsoft/vscode#210475 has no movement behind it and will basically never happen. I don't know whether the TextMate grammar can be replaced by using tree-sitter as input to the VS Code semantic highlighting feature, but that is one possibility. |
Beta Was this translation helpful? Give feedback.
-
For a test corpus to demonstrate the absence of user-visible differences, it must be exhaustive. What is the justification for claiming that this test corpus is exhaustive? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey everyone,
PR #386 sparked an interesting architectural debate that I think deserves broader discussion. The PR adds a simple "Update vars" command, but the implementation choices reveal deeper questions about the parsing strategy.
Currently, we use multiple parsers:
Question: Should we add tree-sitter to this mix?
For tree-sitter:
Concerns:
The real issue
I think this boils down to a fundamental separation of concerns:
Many IDE features (variable extraction, code navigation, folding) need syntactic parsing that works even when SANY would fail. Currently we use regex for this, which... works, but isn't ideal.
Questions for Discussion
I don't have strong opinions yet. Just wanted to surface this discussion from the PR comments. This decision will impact incoming PRs, I suppose, so it's worth getting alignment.
What do you all think?
Beta Was this translation helpful? Give feedback.
All reactions