diff --git a/app/code/Magento/Developer/Model/XmlCatalog/Format/PhpStorm.php b/app/code/Magento/Developer/Model/XmlCatalog/Format/PhpStorm.php index 1ced906cce763..aef58a9a37e89 100644 --- a/app/code/Magento/Developer/Model/XmlCatalog/Format/PhpStorm.php +++ b/app/code/Magento/Developer/Model/XmlCatalog/Format/PhpStorm.php @@ -18,6 +18,8 @@ */ class PhpStorm implements FormatInterface { + private const PROJECT_PATH_IDENTIFIER = '$PROJECT_DIR$'; + /** * @var ReadInterface */ @@ -95,7 +97,7 @@ public function generateCatalog(array $dictionary, $configFilePath) foreach ($dictionary as $urn => $xsdPath) { $node = $dom->createElement('resource'); $node->setAttribute('url', $urn); - $node->setAttribute('location', $xsdPath); + $node->setAttribute('location', $this->getFileLocationInProject($xsdPath)); $componentNode->appendChild($node); } $dom->formatOutput = true; @@ -129,4 +131,15 @@ private function initEmptyFile(\DOMDocument $dom) $projectNode->appendChild($rootComponentNode); return $projectNode; } + + /** + * Resolve xsdpath to xml project path + * + * @param string $xsdPath + * @return string + */ + private function getFileLocationInProject(string $xsdPath): string + { + return self::PROJECT_PATH_IDENTIFIER . DIRECTORY_SEPARATOR . $this->currentDirRead->getRelativePath($xsdPath); + } }