Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Evaluate Deprecating Syntactic Content Assist Support #1165

Open
bd82 opened this issue Apr 11, 2020 · 1 comment
Open

Evaluate Deprecating Syntactic Content Assist Support #1165

bd82 opened this issue Apr 11, 2020 · 1 comment

Comments

@bd82
Copy link
Member

bd82 commented Apr 11, 2020

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
Copy link
Member Author

bd82 commented Nov 6, 2021

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant