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

customizing automatic token deletion recovery by exposing canRecoverWithSingleTokenDeletion API #1753

Closed
medihack opened this issue Jan 29, 2022 · 2 comments · Fixed by #1754

Comments

@medihack
Copy link
Contributor

medihack commented Jan 29, 2022

In my parser I want to overwrite the canRecoverWithSingleTokenDeletion method (similar as in SAP/xml-tools). Unfortunately, I am using Typescript and CstParser does not declare this method of the Recoverable mixin in the type definition. So I end up with the error Property 'canRecoverWithSingleTokenDeletion' does not exist on type 'CstParser' when calling it with super.canRecoverWithSingleTokenDeletion(expectedTokenType). Would it be possible to add it to the type definitions? Otherwise, it is quite hard to work around it. The only thing I can think of is to completely re-declare it.

I created a PR with an added extra method canTokenTypeBeDeletedInRecovery to make the API consistent with the already available canTokenTypeBeInsertedInRecovery.

@medihack medihack changed the title Missing type definitions of parser mixins canRecoverWithSingleTokenDeletion missing in type definitions Jan 29, 2022
@bd82
Copy link
Member

bd82 commented Jan 31, 2022

Seems like a reasonable request.

btw, you can often ignore type errors in TypeScript with // @ts-ignore or // @ts-expect-error

@bd82
Copy link
Member

bd82 commented Jan 31, 2022

I reviewed your #1754 PR

@bd82 bd82 closed this as completed in #1754 Feb 1, 2022
@bd82 bd82 changed the title canRecoverWithSingleTokenDeletion missing in type definitions customizing automatic token deletion recovery by exposing canRecoverWithSingleTokenDeletion API Feb 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants