microsoft / microsoft/monaco-editor
[Bug] Expressions using Python's matrix multiplication operator highlighted as decorator
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 46.8k
- Forks
- 4.1k
- Avg merge
- 17h 58m
- Merged PRs (30d)
- 1
Description
Reproducible in vscode.dev or in VS Code Desktop?
- Not reproducible in vscode.dev or VS Code Desktop
Reproducible in the monaco editor playground?
- Not reproducible in the monaco editor playground
Monaco Editor Playground Link
Monaco Editor Playground Code
x@y
Reproduction Steps
Use the matrix multiplication operator in a Python expression without placing a space after the operator.
Actual (Problematic) Behavior
a@b gets syntax highlighted as if @b were a decorator. It is not.
Expected Behavior
a@b being syntax highlighted the same as a @ b since whitespace does not change meaning there.
Additional Context
https://peps.python.org/pep-0465/ relevant pep
https://python.godbolt.org/z/devGMWf11 actual usage example. Compiler Explorer uses Monaco.
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 issue in the Monaco Editor Playground using the provided x@y example, then compare it with x @ y. Trace the Python syntax-highlighting rules responsible for decorators and matrix multiplication, and add regression coverage showing both forms receive equivalent highlighting. Done means the compact expression is no longer treated as a decorator.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- developer-experience, frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100