microsoft / microsoft/pxt-microbit

Reformatting of Code in switch between code and block views is annoying

Open
#1,066 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

blocksToCode
Dominant language
TypeScript
Stars
804
Forks
721
Avg merge
2d 9h
Merged PRs (30d)
2

Description

I'm currently writing some complicated code in the code view.
To help me (and others) follow it I have laid it out in a specific way.

When I switch to the block view the layout gets re formatted. Its not just tabs / spaces, but blocks are moved around into different places.

I can see no reason to deliberately do this, and it means that the code changes its look as it progresses.
It could also be confusing for a novice user who is referring back to blocks as a help to get the correct things into their program.

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.

Research direction

Reproduce the issue by entering formatted code in the code view and switching to the block view, then compare the layout after switching back. Trace the editor's code/block view conversion behavior; done means switching views no longer moves blocks or changes the user's intentional layout.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.