On Magento 2 XML, we declare the path of the XSD schema with this line :
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
But PHP Storm doesn’t know the “urn” part and show the pathfile with red. So, PHP Storm doesn’t check the XML structure with it’s schema.
You can add this functionnality by type these commandes :
cp ./.idea/misc.xml ./.idea/misc.xml.bak ./bin/magento dev:urn-catalog:generate .idea/misc.xml
First, we make a backup of our file, if you have a problem, restore it.
After, we execute a script which resolve the PHP Storm schema location.
The pathfile will be green, and the schema validation is effective.
Xml Schema resolution in PHP Storm with Magento2 Urns
Just install https://plugins.jetbrains.com/plugin/8024 go to plugin settings and click “Regenerate urn map” button.
For feature requests/additional information please refer to https://github.com/dkvashninbay/magento2plugin