microsoft / microsoft/pxt

groups attribute is not properly processed

Open
#7,258 4 comments 0 reactions 1 assignee View on GitHub

@ganicke is already working on this.

Since Nov 10, 2020.

devdocs
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

  1. Go to https://makecode.com/playground#basic-groups
  2. Click "Run"
  3. Replace //% groups="['Fruits', 'Veggies']" with //% groups=['Fruits', 'Veggies']
  4. Click "Run"
  5. Replace //% groups=['Fruits', 'Veggies'] with //% groups=["Fruits", "Veggies"]
  6. Click "Run"
  7. Replace //% groups=["Fruits", "Veggies"] with //% groups='["Fruits", "Veggies"]'
  8. Click "Run"

Actual behavior
After Step 2, 4 and 6:
image

After Step 8:
image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.