Vscode-intelephense: "property value expected css" error when adding PHP code to HTML inline style

Created on 12 Dec 2019  路  5Comments  路  Source: bmewburn/vscode-intelephense

Describe the bug
When I add PHP code to inline CSS, I get the error:

property value expectedcss(css-propertyvalueexpected)

To Reproduce
Paste this example into VSCode

<?php $color = '#000'; ?>
<div style="background-color:<?= $color ?>">
    <p>Example</p>
</div>

Screenshots
css

Platform and version
Windows 10, Intelephense 1.3.3

Most helpful comment

Disabling intelephense.diagnostics.embeddedLanguages works for me

All 5 comments

This is not an extension warning, but vscode. You can disable validation for embedded styles with setting html.validate.styles.

@KapitanOczywisty
No, disabling this option does't help.
When I disable the Intelephense extension, this error is gone

This is the same as #836 but with CSS in this case. 1.3 now has embedded language diagnostics. It involves having multiple language services working together with each only understanding the language they were written for.

The CSS language service works off a virtual document that has the php section removed which can cause it to encounter errors that would not exist in the html/css/js after the php script has been run. Does setting html.validate.styles and restarting vscode work? You can also turn off embedded language diagnostics with intelephense.diagnostics.embeddedLanguages . Tracking other solutions to this in #836 .

Disabling intelephense.diagnostics.embeddedLanguages works for me

Also disabling intelephense.diagnostics.embeddedLanguages worked for me! thank you.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

9brada6 picture 9brada6  路  3Comments

umpirsky picture umpirsky  路  4Comments

superadmini picture superadmini  路  4Comments

muuvmuuv picture muuvmuuv  路  4Comments

pseudoanime picture pseudoanime  路  3Comments