Repository: vscode
Issue: Strange bug in PHP files with HTML and Emmet parser because conditionals are been mistaken as opening and/or closing tags
Labels: bug,upstream,php,emmet,upstream-issue-linked


Issue Type: <b>Bug</b>

1. Open or create a PHP file
2. Type the following example code:
```php
<?php
$looping = 1;
$while = [];

while ($looping <= 5) {
//here you can't use emmet or html! give it a try!
    $while[] = $looping;
    $looping++;
}
var_dump($while);

$looping = 5;
$while = [];

do {
    $while[] = $looping;
    $looping--;
} while ($looping >= 1);
var_dump($while);

//here you can use emmet and html

for ($i = 1; $i <= 10; ) {
    //here you can't use emmet or html. give it a try!
}
```
**Expected result**: Emmet and HTML should continue working and the parser should correctly identify conditionals as not part of an opening or ending tag statement.

Tested without any extensions enabled. It is a core php bug in the editor.

**Screenshots** to illustrate the actual results with current stable version:
Emmet and HTML parsing does not work after using the conditional, because it is trying to parse it as an opening tag
![bug-report-php-language-html-not-working](https://user-images.githubusercontent.com/9614642/82623762-49efe380-9bb7-11ea-8ad9-e558b55291e6.png)

Here the parsing works, because the while and do-while have complement conditionals, thus opening and closing a tag, for the html parser
![bug-report-php-language-html-not-working-2](https://user-images.githubusercontent.com/9614642/82623776-5bd18680-9bb7-11ea-9f6b-60861548758a.png)

Just to make it more clear about the opening/closing tag described above
![bug-report-php-language-html-not-working-3](https://user-images.githubusercontent.com/9614642/82623967-d8646500-9bb7-11ea-97e4-2ca782f1b67c.png)

It is a parsing bug because it will resume working after typing the matched closing tag even in a comment
![bug-report-php-language-html-not-working-4](https://user-images.githubusercontent.com/9614642/82624010-f5993380-9bb7-11ea-8c27-aa67a5d3600f.png)

I love VSCode and it has been really productive in my daily PHP work. I hope the issue gets addressed and fixed. Thank you for your time and attention on reading this lengthy report.


VS Code version: Code 1.45.1 (5763d909d5f12fe19f215cbfdd29a91c0fa9208a, 2020-05-14T08:27:35.169Z)
OS version: Windows_NT x64 10.0.18363

<details>
<summary>System Info</summary>

|Item|Value|
|---|---|
|CPUs|Intel(R) Core(TM) i7-3770K CPU @ 3.50GHz (8 x 3492)|
|GPU Status|2d_canvas: enabled<br>flash_3d: enabled<br>flash_stage3d: enabled<br>flash_stage3d_baseline: enabled<br>gpu_compositing: enabled<br>multiple_raster_threads: enabled_on<br>oop_rasterization: disabled_off<br>protected_video_decode: unavailable_off<br>rasterization: enabled<br>skia_renderer: disabled_off_ok<br>video_decode: enabled<br>viz_display_compositor: enabled_on<br>viz_hit_test_surface_layer: disabled_off_ok<br>webgl: enabled<br>webgl2: enabled|
|Load (avg)|undefined|
|Memory (System)|11.95GB (7.36GB free)|
|Process Argv||
|Screen Reader|no|
|VM|0%|
</details><details><summary>Extensions (4)</summary>

Extension|Author (truncated)|Version
---|---|---
vscode-intelephense-client|bme|1.3.11
vscode-toggle-quotes|Bri|0.3.2
path-autocomplete|ion|1.13.6
google-fonts|lio|0.0.1


</details>
<!-- generated by issue reporter -->