chevrotain
chevrotain copied to clipboard
Evaluate Deprecating Syntactic Content Assist Support
- https://sap.github.io/chevrotain/docs/features/syntactic_content_assist.html
The issues are:
-
This feature is not orthogonal with other features (e.g error recovery/gates) as it is implemented as a separate interpreter directly on the GAST structure. Basically it is a different flow to the regular parsing flow.
-
This feature is slow (due to interpreter approach).
-
Such a feature should probably be implemented on the CST structure post parsing. See: https://github.com/SAP/xml-tools/tree/master/packages/content-assist
-
General need to reduce API surface area and complexity of Chevrotain.
I've started looking into this and it does not seem that removing this feature will actually git rid of significant amount of productive code. (~150 LOC). Maybe it is best to change the API instead of removing it completely?
- [ ] Expose it as a utility
NextPossibleTokenAfter
- [ ] Document it could be used for trivial content assist and its limitations (small input size, e.g when each line known to be a different statement).
- [ ] Provide a more complex content assist example that builds upon error recovery and CST visitor (like in XML-Tools) - Such an example can also implement semantic content assist. - Perhaps SQL like syntax in the tutorial would be a good place to expand upon.
One thing to consider is the value of such NextPossibleTokenAfter
utility?
Does it have a legitimate purpose?