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

fix: improve translation error detection #25

Merged
merged 1 commit into from
Feb 27, 2024

Conversation

mehalter
Copy link
Contributor

This improves the error detection by not necessarily requiring the number of matches to equal the number of parameters. This happens when the number of parameters are 0 but there is a quoted string in the message. It should only error if it is unable to retrieve a specific match.

This also has some performance stuff by doing less if there are no errors or parameters

@mehalter
Copy link
Contributor Author

here is an example of an error code that didn't work because it has no parameters but does have 'const' in the diagnostic text

image

Copy link
Owner

@dmmulroy dmmulroy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm - @mehalter thank you again for jumping into this project! Any shot I could buy you a coffee somehow?

I'd also note that I'm working on rewriting and trying to more closely match the parseEngine from Matt Pococks TS implementation for VS - in fact I found a bug in the original this morning while working through it :) (mattpocock/ts-error-translator#268 (comment))

I wrote the internals of this quite a few months ago to support some other work and deviated from the way his worked to support those goals, so working on getting back to the baseline now

@dmmulroy dmmulroy merged commit 1d24a38 into dmmulroy:main Feb 27, 2024
@mehalter
Copy link
Contributor Author

Nah for reals, no worries at all! I'm glad to help out! I am the maintainer of AstroNvim and the users over on our discord have been excited about your plugin and getting it into the AstroNvim ecosystem!

@mehalter mehalter deleted the no_param_fix branch February 27, 2024 17:01
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 this pull request may close these issues.

2 participants