Generated code formatting (indents and semicolons)
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.3k
- Forks
- 641
- Avg merge
- 12h 4m
- Merged PRs (30d)
- 57
Description
Feature request template
Is your feature request related to a problem? Please describe.
I would like there to be a way to set the size of indents in the code that gets generated when I flip over into the Monaco editor, and to turn on semicolons at the ends of lines. Four spaces for an indent results in a lot of negative space on the screen which on something like a low-end Chromebook is at a premium. I'd also like to see a way to have trailing semicolons on lines, because I'm an old man who thinks that not finishing your lines with a semicolon is like not wearing socks with shoes and a suit - sure, you can and the young hipsters might like how it looks, but it doesn't feel properly dressed without it!
I guess this could go further and provide a means to expose more Monaco options (I'm a fan of showing whitespace characters, for example).
Describe the solution you'd like
The project files, shown in Explorer, already allows access to pxt.json - it might be worth including linting/formatting settings in here to be passed through to the code generation and Monaco editor settings.
Describe alternatives you've considered
I've been searching for these settings since I got hold of a microbit! I've considered going as far as reflashing it with https://github.com/espruino/Espruino but I'd prefer to keep the experience as stock as possible for my son.
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 by tracing how pxt.json is exposed in the Explorer and how generated code is handed to the Monaco editor. Determine how indent size, semicolon preferences, and other requested Monaco options should be represented and passed through. Done means these settings can be configured and affect generated code and editor formatting.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- developer-experience, frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100