microsoft / microsoft/pxt-microbit
Inline comments are ignored in Python when returning to blocks
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 804
- Forks
- 721
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 2
Description
Describe the bug
There appears to be a difference in behaviour when someone tries to use inline comments in Python and switch to blocks and back. Not sure what the default behaviour is supposed to be.
It seems that when someone adds an inline comment in Python and switches to blocks and back, the comment is ignored. If the comment is added on a new line it is included as part of the block for the code below it.
In Javascript, a line-level comment appears to be moved to a new line when you switch to blocks and then remains on that line when y
To Reproduce
Expected behavior
I would expect that if I added a comment at the end of a line, that it would stay there when I switch between languages
Desktop (please complete the following information):
- OS: [e.g. iOS] Mac
- Browser [e.g. chrome, safari] Firefox
- Version [e.g. 22] 89
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
Reproduce the behavior shown in the linked video by adding an inline Python comment, switching to blocks, and switching back. Start by tracing the editor's Python-to-blocks and blocks-to-Python conversion paths; done means an end-of-line comment remains attached to its original line, including when switching languages repeatedly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, python, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100