I am a newbie. My editor uses tree-sitter to parse source files. For lack of a purescript grammar on the published list , they replaced it with the haskell grammar !
Do you think this is somewhat ok ?
Do you think this is totally outrageous for purescript-lang ?
In fact, the ACE editor used in try.purescript.org uses ACE’s Haskell grammar for PureScript syntax highlighting, so you’re in good company. The only times I even notice the difference is when it specially highlights function names that are in the Haskell prelude but missing, or named differently, in the PureScript prelude/core libraries. (No idea if Tree-sitter’s grammars do the same sort of thing, but I suspect they are unlikely to fail in a more annoying way than that.)
Grammars in editors like ace usually just lexeme based (or very simple state machines), where tree-sitter is meant to parse a full concrete syntax. I think the grammars are sufficiently different that you would never have a fully parsed document. For just highlighting, this may be ok depending on how fine grained the error recovery is, but if it’s used for any other feedback it’s probably unusable, unfortunately.