PHP LSP reports incorrectly: Syntax error: unexpected token '<' #8254

Open
opened 2026-02-16 18:09:32 -05:00 by yindo · 1 comment
Owner

Originally created by @colinmollenhour on GitHub (Feb 1, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

Not sure when this started, but the LSP is often reporting syntax errors after making edits to PHP files. The LLM correctly recognizes that it is a false positive, but why would it do this in the first place?

I've checked, and the files definitely don't have that character on the last line, which is always where it reports it (actually I think it's one line after the last line). I've not seen this with any IDEs like VS Code, which I also use with devsense, so it makes me suspect it is specific to OpenCode somehow, but I also reported it here: https://community.devsense.com/d/2509-opencode-shows-devsense-is-reporting-false-positive-syntax-errors

Plugins

No response

OpenCode version

1.1.48

Steps to reproduce

Launch a project with a PHP file, prompt opencode to edit the file.

Screenshot and/or share link

Image Image

Here is a minimal reproduction:

Image

Operating System

Ubuntu in WSL

Terminal

Windows Terminal

Originally created by @colinmollenhour on GitHub (Feb 1, 2026). Originally assigned to: @rekram1-node on GitHub. ### Description Not sure when this started, but the LSP is often reporting syntax errors after making edits to PHP files. The LLM correctly recognizes that it is a false positive, but why would it do this in the first place? I've checked, and the files definitely don't have that character on the last line, which is always where it reports it (actually I think it's one line after the last line). I've not seen this with any IDEs like VS Code, which I also use with devsense, so it makes me suspect it is specific to OpenCode somehow, but I also reported it here: https://community.devsense.com/d/2509-opencode-shows-devsense-is-reporting-false-positive-syntax-errors ### Plugins _No response_ ### OpenCode version 1.1.48 ### Steps to reproduce Launch a project with a PHP file, prompt opencode to edit the file. ### Screenshot and/or share link <img width="2489" height="1100" alt="Image" src="https://github.com/user-attachments/assets/7472dff2-6011-4d39-b833-163d485bb757" /> <img width="1837" height="392" alt="Image" src="https://github.com/user-attachments/assets/ce7b795a-012a-469d-9720-1f817dbea7d9" /> Here is a minimal reproduction: <img width="1915" height="1495" alt="Image" src="https://github.com/user-attachments/assets/d9b26a40-0319-4a7f-ae08-b3d3950f25dc" /> ### Operating System Ubuntu in WSL ### Terminal Windows Terminal
yindo added the windowsbug labels 2026-02-16 18:09:32 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Feb 1, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #9102: Agents misinterpret LSP diagnostics as failed edits

The symptoms are related - both involve false positive LSP diagnostics being reported after file operations. Feel free to ignore if this is specific to PHP or has different underlying causes.

@github-actions[bot] commented on GitHub (Feb 1, 2026): This issue might be a duplicate of existing issues. Please check: - #9102: Agents misinterpret LSP diagnostics as failed edits The symptoms are related - both involve false positive LSP diagnostics being reported after file operations. Feel free to ignore if this is specific to PHP or has different underlying causes.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#8254