Open alanz opened 3 years ago
Replaces ReaderC with StateC in Unmarshal, and checks for diagnostics at each visited node, kept in the state.
ReaderC
StateC
Unmarshal
The diagnostic determination is dodgy, but the concept works
See https://gist.github.com/alanz/2ae23a75bba75ed09780d3fa043bd28e
Note: haskell-tree-sitter is a git dep, it needs a "git submodule update" in the appropriate "dist-newstyle/src" directory.
Related issues: #574 #638 .
Alternative approaches are to extend the query capabilities, as requested in https://github.com/tree-sitter/tree-sitter/issues/606
The ts_node_has_error and ts_node_is_missing_p calls are not the right ones, the detailed info comes from the logic in https://github.com/tree-sitter/tree-sitter/blob/2b0de9dfec62af7e74c319abe80912b02dca74be/lib/src/subtree.c#L846-L894
ts_node_has_error
ts_node_is_missing_p
and
https://github.com/tree-sitter/tree-sitter/blob/2b0de9dfec62af7e74c319abe80912b02dca74be/lib/src/language.c#L67-L80
Replaces
ReaderC
withStateC
inUnmarshal
, and checks for diagnostics at each visited node, kept in the state.The diagnostic determination is dodgy, but the concept works
See https://gist.github.com/alanz/2ae23a75bba75ed09780d3fa043bd28e
Note: haskell-tree-sitter is a git dep, it needs a "git submodule update" in the appropriate "dist-newstyle/src" directory.
Related issues: #574 #638 .
Alternative approaches are to extend the query capabilities, as requested in https://github.com/tree-sitter/tree-sitter/issues/606
The
ts_node_has_error
andts_node_is_missing_p
calls are not the right ones, the detailed info comes from the logic in https://github.com/tree-sitter/tree-sitter/blob/2b0de9dfec62af7e74c319abe80912b02dca74be/lib/src/subtree.c#L846-L894and
https://github.com/tree-sitter/tree-sitter/blob/2b0de9dfec62af7e74c319abe80912b02dca74be/lib/src/language.c#L67-L80