groups attribute is not properly processed
@ganicke is already working on this.
Since Nov 10, 2020.
- Dominant language
- TypeScript
- Stars
- 2.3k
- Forks
- 641
- Avg merge
- 12h 4m
- Merged PRs (30d)
- 57
Description
Describe the bug
According to https://makecode.com/defining-blocks#category,
To define your groups, add the groups attribute to your namespace. The groups attribute is an array of group names.
The order in which you define your groups is the order in which the groups will appear in the toolbox flyout
, and it has a sample syntax of the groups attribute:
//% groups=['LED matrix', 'Control flow', 'others']
Unfortunately, that does work.
On https://makecode.com/playground#basic-groups, another syntax is shown:
//% groups="['Fruits', 'Veggies']"
Sadly, that does not work either.
The only syntax that appears to work is as follows:
//% groups='["Fruits", "Veggies"]'
I think either the above samples should amended, or the parser should support all of them.
To Reproduce
- Go to https://makecode.com/playground#basic-groups
- Click "Run"
- Replace
//% groups="['Fruits', 'Veggies']"with//% groups=['Fruits', 'Veggies'] - Click "Run"
- Replace
//% groups=['Fruits', 'Veggies']with//% groups=["Fruits", "Veggies"] - Click "Run"
- Replace
//% groups=["Fruits", "Veggies"]with//% groups='["Fruits", "Veggies"]' - Click "Run"
Actual behavior
After Step 2, 4 and 6:

After Step 8:

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.
Assessment
This issue has not been assessed yet.