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

Check for misspelled JavaScript keywords #2081

Open
arrowtype opened this issue Jan 13, 2020 · 1 comment
Open

Check for misspelled JavaScript keywords #2081

arrowtype opened this issue Jan 13, 2020 · 1 comment

Comments

@arrowtype
Copy link

Is your feature request related to a problem? Please describe.

The other day in a Code Nation classroom, a student had written out a simple jQuery function, but their code wasn’t working. One of the teachers couldn’t see anything wrong, and thought maybe popcode wasn’t working. Eventually, I spotted the problem: the word function was misspelled, I think as fucntion or some reversal of two letters.

Describe the solution you'd like

A small solution would be adding a specific check for misspellings of function, perhaps in contexts where we could deduce the intended word.

A bigger scope but possibly a better solution would be a code “spellchecker,” which would be super helpful in cases like this. Simple typing/spelling errors where key words are off by one letter are super common, especially for beginners (but possible for anyone and hard to debug). Other common issues are missed capitalization or hyphenation, and I believe we should try to capture these if possible, as well.

@outoftime outoftime changed the title Check spelling of “function” in jQuery Check for misspelled JavaScript keywords Jan 13, 2020
@outoftime
Copy link
Contributor

Good call! Weʼd probably need some pretty nuanced heuristics—for instance, itʼs entirely possible to have a perfectly good function name that happens to look like a misspelling of function, so at a minimum we would only want to apply the spell check if there is an overall syntax error in the code. Even better would be to see what happens when the misspelling is corrected, and only suggest that correction if it resolves a syntax error. So in that sense this is part of a larger class of enhancements to the error checker that would operate by trying out certain fixes for problems and then tailoring the error output based on the outcome.

Anyway, overall Iʼd love to see this but it would be a pretty big project! Happy to advise anyone who wants to dive in on it.

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

2 participants