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 #15

Open
alexr00 opened this issue Dec 5, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@alexr00
Copy link

alexr00 commented Dec 5, 2023

Description

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

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.

Actual 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

Reproduces how often: always

Versions

VS Code 1.84.2

Additional Information

Originally from @php4fan in microsoft/vscode#199790

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants