Check against language keywords before creating sprite kind.
Open
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.3k
- Forks
- 641
- Avg merge
- 12h 4m
- Merged PRs (30d)
- 57
Description


Creating a kind with name of a language keyword breaks the ts code, stopping the project from running.
Should check against keywords and add '_' like that on creating variables?
https://github.com/microsoft/pxt/blob/fb6eaa80001d77892055dbb3839094c60c038aca/pxtblocks/fields/field_kind.ts#L88
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in pxtblocks/fields/field_kind.ts around line 88, where the sprite kind name is created. Reproduce the issue with a language keyword as the kind name and inspect the generated TypeScript. Done means keyword names no longer break the generated code while ordinary kind names continue to work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100