Safe delete doesn't check XML file
I'm deleting a CSS file that is referenced in an XML file. I select "Safe delete (with usage search)" and "Search in comments and strings" but the reference in the XML file is not found.
The XML file is in a directory included in the project. The XML file contains the complete file name in a string.
Are there some settings for Safe Delete somewhere or something more general that might exclude XML files?
Thanks for any help.
<resourceSet name="HeaderStylesCss" type="css">
<resource path="~/Legacy/Content/Css/HeaderStyles.css"/>
</resourceSet>
Please sign in to leave a comment.
No, it's not possible, as it would require ading special support for
XML tag: right now, this value is treated as simple string, so CSS file usage is not found and thus not taken into account when deleting a file
You can try injecting File reference language in path="" value manually via Alt+Enter, Inject language or reference:
but paths starting with `~` won't work there, I'd suggest using relative paths rather than absolute
I'm not expecting to find it as an absolute usage. I expecting to find it under "comment or strings". If I add a comment in a .js file with the file name it will find it. But Webstorm doesn't check anything it considers not a "code" file. Is there no setting to expand this search to all files?
@Elena what does injecting file reference do? The application root ~ paths have to remain as the XML file is used in a .Net MVC application.
>Is there no setting to expand this search to all files?
no
>what does injecting reference do?
it injects a different language into a string value, providing a special treatment for it. With injections you can add a block of code in a language different from the main language of this file and get coding assistance for this block.
Default injections are hard-coded. But you can create your own injections using 'Inject language/reference' intention available on Alt+Enter. Note that these custom injections only work inside string literals. See https://www.jetbrains.com/webstorm/help/using-language-injections.html, http://jetbrains.dzone.com/articles/become-polyglot-language
@Elena I looked up the documentation before asking the question but it doesn't explain what a file reference does? I was expecting to be able to select the file that the string is referencing. But it seem to do nothing for me - even in a JavaScript file with strings containing file paths.
File reference injection allows to complete the path
navigate to file via Ctrl+click
validate the path