microsoft / microsoft/monaco-editor
[Feature Request] Add suuport for php8 attributes
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 46.8k
- Forks
- 4.1k
- Avg merge
- 17h 58m
- Merged PRs (30d)
- 1
Description
Context
- This issue is not a bug report. (please use a different template for reporting a bug)
- This issue is not a duplicate of an existing issue. (please use the search to find existing issues)
Description
In the php 8 there is a new mechanism, which is attributes. However, in editor, they look like comments. E.g.
#[Attr(...), Attr(...)]
private int $a;

In single lines it can be skipped, but attributes can be multilines, what makes it totally wrongly colored. E.g.
#[ArrayShape([
'id' => 'int',
'month' => 'int',
'day' => 'int',
'usual' => 'int'
])]

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
The issue provides single-line and multiline PHP 8 attribute examples but names no files or tests. Start by locating Monaco Editor's PHP language support and related syntax-highlighting tests, then verify that attributes and their multiline contents are colored as PHP syntax rather than comments. Done means both examples render with appropriate highlighting.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, php
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100