chevrotain icon indicating copy to clipboard operation
chevrotain copied to clipboard

Evaluate Deprecating Syntactic Content Assist Support

Open bd82 opened this issue 4 years ago • 1 comments

  • https://sap.github.io/chevrotain/docs/features/syntactic_content_assist.html

The issues are:

  1. 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.

  2. This feature is slow (due to interpreter approach).

  3. 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

  4. General need to reduce API surface area and complexity of Chevrotain.

bd82 avatar Apr 11 '20 14:04 bd82

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?

bd82 avatar Nov 06 '21 23:11 bd82