Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP Syntax highlight doesn't handle {$variables} in double-quoted strings #199790

Closed
php4fan opened this issue Dec 1, 2023 · 2 comments
Closed
Assignees
Labels
grammar Syntax highlighting grammar upstream-issue-linked This is an upstream issue that has been reported upstream

Comments

@php4fan
Copy link

php4fan commented Dec 1, 2023

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.84.2
  • OS Version: Manjaro Linux

Steps to Reproduce:

  1. Write this in a PHP file:
<?php

$array = ['x' => 'y'];

$string = "Lorem ipsum {$array['x']}";

Expected behavior

In the above code in PHP, the chunk {$array['x']} is expanded into the value of what's inside the {}, which is an element of the array.
The braces should be somehow highlighted, and $array['x'] shoould be highlighted in a way similar to how array elements are highlighted outside of a string: with the array name, brackets, and index highlighted in different colors.

Observed behavior

It is highlighted like this:

image

as if

  • the braces were just part of the string,
  • only the variable $array itself were expanded, and
  • the portion ['x'] were again just part of the string
@lszomoru
Copy link
Member

lszomoru commented Dec 4, 2023

@jrieken, could you please help with triaging this issue? Thank you!

@alexr00
Copy link
Member

alexr00 commented Dec 5, 2023

Moved to KapitanOczywisty/language-php#15

@alexr00 alexr00 closed this as completed Dec 5, 2023
@alexr00 alexr00 added grammar Syntax highlighting grammar upstream-issue-linked This is an upstream issue that has been reported upstream labels Dec 5, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Jan 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
grammar Syntax highlighting grammar upstream-issue-linked This is an upstream issue that has been reported upstream
Projects
None yet
Development

No branches or pull requests

5 participants