-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
FES: spelling and caps detection #4643
FES: spelling and caps detection #4643
Conversation
055699d
to
84b1556
Compare
I guess this is ready for review. So as I mentioned in #4637, there are two types of checks:
Type 2 works for both global and instance mode. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fantastic! Just a few requests inline to help with clarity.
Also I just noticed that the error handler is not triggered when |
@stalgiag I have made the changes as you suggested. Please let me know your views on this comment. If need be, I will change the I have also fixed the problem of But when p5.sound or some other library is present, an error in the sketch would result in this other promise failing. So I changed it to instead listen for any PromiseRejectionEvents or any ErrorEvents here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! This is a very exciting set of changes.
Resolves #4637
Changes:
I have tried the simpler check using
toLowerCase()
as suggested by @limzykenneth .Seems to work well to capture all kinds of mistakes in capitalization. For the sketch
and for the sketch
We get
And for
We get
Performance-wise the only concern was
checkForUserDefinedFunctions
as it would have to run the check regardless of whether there is an actual error or not. But it seems to run in under a millisecond and it will run only once, after p5 is initialized.fesErrorMonitor
shouldn't be a problem for performance as it only runs when we have an actual error.This only captures capitalization mistakes.
I will try to capture the ones for spelling now and also add tests
Update:
Now works for spelling mistakes too. For
Also added a few tests
PR Checklist
npm run lint
passes