microsoft / microsoft/monaco-editor

PHP: support for code snippets without the starting `<?php` token

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

Nobody has claimed this yet.

feature-request grammars help wanted
Dominant language
JavaScript
Stars
46.8k
Forks
4.1k
Avg merge
17h 58m
Merged PRs (30d)
1

Description

monaco-editor version: 0.18.1

Steps or JS usage snippet reproducing the issue:

The following snippet doesn't get highlighted properly because the starting <?php token is missing, I think it should get highlighted better, like GitHub is doing, even though the current behavior is probably overall more correct, but kind of too strict.

public function index() {
    $projects = Project::all();

    return view('projects.index', compact('projects'));
}

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

No files or tests are named in the issue. Start by reproducing the provided PHP snippet in Monaco 0.18.1 and inspect the PHP syntax-highlighting behavior when the opening token is absent; done means the snippet receives useful highlighting without requiring <?php.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.