Agents Window - Syntax highlighting breaks in review files list

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

In the agents window when looking at the files to review, the syntax highlighting breaks after a some lines and just show the lines without highlighting. Not sure if it’s specific to PHP files or just with any files.

Steps to Reproduce

  1. Make the agent do big changes across multiple files
  2. Click on review changes
  3. The syntax highlighting stops on every file after a while or right from the start of the file sometimes

Expected Behavior

All of the files should keep their highlighted syntax

Operating System

MacOS

Version Information

Version: 3.9.8
VS Code Extension API: 1.105.1
Commit: 4aa8ff1b7877ed7bd01bcba308698f71a6735380
Date: 2026-06-25T01:39:30.490Z
Layout: glass
Build Type: Stable
Release Track: Default
Electron: 40.10.3
Chromium: 144.0.7559.236
Node.js: 24.15.0
V8: 14.4.258.32-electron.0
xterm.js: 6.1.0-beta.256
OS: Darwin arm64 25.5.0

Additional Information

Using PHP devsense extension of the syntax highlighting in the IDE and it works fine in the agents window when looking at the file directly not in review mode.

Does this stop you from using Cursor

No - Cursor works, but with this issue

Thanks for the report @raphael-yapla!

There is a known issue where syntax highlighting stops working when a diff in the Agents Window contains a file whose original or modified text exceeds 200,000 characters, or whose modified line numbers extend beyond line 1,500. Does that match what you’re experiencing?

No actually it stops working halfway even on small files, the number of lines doesn’t seem to impact it. For example I got the issue on a file with 150 lines.

Here’s the file anonymized if you want to reproduce it on your side:

<?php

namespace Example\Import;

use Example\Validators\RegionCode;
use Example\Validators\PriorityLevel;
use Example\Validators\ProcessingMode;
use Example\Validators\ContentTag;
use Example\Validators\OwnerAlias;

final class ImportFilterCriteria
{
	/**
	 * @param list<string> $tags
	 */
	private function __construct(
		public readonly ?int $regionCode = null,
		public readonly ?int $priorityLevel = null,
		public readonly array $tags = [],
		public readonly ?string $processingMode = null,
		public readonly ?string $ownerAlias = null,
	) {
	}

	public function isBlank(): bool
	{
		return $this->regionCode === null
			&& $this->priorityLevel === null
			&& $this->tags === []
			&& $this->processingMode === null
			&& $this->ownerAlias === null;
	}

	/**
	 * @param array<string, mixed>|object|null $snapshot
	 */
	public static function fromRequestSnapshot(array|object|null $snapshot): self
	{
		if ($snapshot === null) {
			return new self();
		}

		$raw = (array) $snapshot;

		$regionCode = self::coerceInteger($raw['region_code'] ?? $raw['regionCode'] ?? null);
		if ($regionCode !== null && !RegionCode::isAllowed($regionCode)) {
			$regionCode = null;
		}

		$priorityLevel = self::coerceInteger($raw['priority_level'] ?? $raw['priorityLevel'] ?? null);
		if ($priorityLevel !== null && !PriorityLevel::isAllowed($priorityLevel)) {
			$priorityLevel = null;
		}

		$processingMode = self::coerceText($raw['processing_mode'] ?? $raw['processingMode'] ?? null);
		if ($processingMode !== null && !ProcessingMode::isAllowed($processingMode)) {
			$processingMode = null;
		}

		$ownerAlias = self::coerceText(
			$raw['owner_alias'] ?? $raw['ownerAlias'] ?? $raw['alias'] ?? null
		);
		if ($ownerAlias !== null && !OwnerAlias::isAllowed($ownerAlias)) {
			$ownerAlias = null;
		}

		return new self(
			$regionCode,
			$priorityLevel,
			self::collectTags($raw['tags'] ?? null),
			$processingMode,
			$ownerAlias,
		);
	}

	/**
	 * @param array<string, mixed> $exportRow
	 * @return array<string, mixed>
	 */
	public function applyToExportRow(array $exportRow): array
	{
		if ($this->regionCode !== null) {
			$exportRow['region'] = $this->regionCode;
		}

		if ($this->priorityLevel !== null) {
			$exportRow['priority'] = $this->priorityLevel;
		}

		if ($this->tags !== []) {
			$exportRow['tags'] = $this->tags;
		}

		if ($this->processingMode !== null) {
			$exportRow['processing_mode'] = $this->processingMode;
		}

		if ($this->ownerAlias !== null) {
			$exportRow['owner_alias'] = $this->ownerAlias;
		}

		return $exportRow;
	}

	/**
	 * @return list<string>
	 */
	private static function collectTags(mixed $tags): array
	{
		if (!is_array($tags)) {
			return [];
		}

		$accepted = [];
		foreach ($tags as $tag) {
			if (is_string($tag) && ContentTag::isAllowed($tag)) {
				$accepted[] = $tag;
			}
		}

		return $accepted;
	}

	private static function coerceInteger(mixed $input): ?int
	{
		if ($input === null || $input === '') {
			return null;
		}

		if (is_int($input)) {
			return $input;
		}

		if (is_string($input) && is_numeric($input)) {
			return (int) $input;
		}

		return null;
	}

	private static function coerceText(mixed $input): ?string
	{
		if (!is_string($input) || $input === '') {
			return null;
		}

		return $input;
	}
}

We use DEVSENSE PHP extension for the linting in VSCode although I’m not sure it’s relevant in the Agents Window.

This happens specifically in the Changes tab of the Glass window. Another interesting detail I’ve noted is that the highlighting doesn’t always break in the same spot. Sometimes it’s further down in the file and I can make it change places by switching from the other tabs like Files or Terminal and back to the Changes. Very odd.

Thanks @raphael-yapla!

Sorry for the late reply here. I haven’t been able to reproduce on v3.11.

Can you check if the issue is still there? A screenshot would also be great if you have one.

@Colin Thanks for the update!

It’s still happening on 3.11.19, it seems to be more prominent where they are a mix of file types or multiple files at least.

Right now I have 5 modified files and only one of them has correct syntax highlighting. I noticed that it happens more frequently when the changes are in the middle of the files than on added files diffs (although with the file I pasted here it was also happening on it).

Maybe adding that files multiple times or with some Vue files thrown in the mix might get you to reproduce my bug?

I don’t really have the time right now to set up a minimal reproduction I could share but if you still can’t reproduce it with the additional info above let me know and I might give it a shot to help you with that

Just even a screenshot would be helpful. :slight_smile:

Here’s an example:

Thanks @raphael-yapla

Good news: I can reproduce this! And it definitely seems to be linked to multiple languages, which means multiple tokenizers/grammars load at once. I’ve been able to build a repo that consistently reproduces this, and I’ve filed a bug with the team. :folded_hands:

Thanks again for the report.