microsoft / microsoft/monaco-editor

[Bug] Code validation (syntax error) does not work for php language

Open
#4,781 7 comments 0 reactions 0 assignees View on GitHub

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?
Monaco Editor Playground Link

No response

Monaco Editor Playground Code
<?php
// The next line contains a syntax error:
if () {
  return "The parser recovers from this type of syntax error"
}
?>
Reproduction Steps

Write a syntax error, like missing condition in if statement or missing a ;

Actual (Problematic) Behavior

Code validation (syntax error) does not work for php language

It does not work in demo either (microsoft.github.io/monaco-editor)

If you select PHP language, the first comment is "the next line contains a syntax error". But the "next line" (which has a syntax error) is not highlighted

Expected Behavior

Code validation works

Additional Context

No response

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

Start by reproducing the PHP snippet in the Monaco Editor Playground and the Monaco Editor demo, then trace how PHP syntax errors are validated and highlighted. Done means errors such as an empty if condition or missing semicolon are detected and visibly reported in both reproduction environments.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.