How can I change the file type association of an existing file in WebStorm?

后端 未结 10 1296
予麋鹿
予麋鹿 2020-12-23 00:28

I accidentally created a file with no extension and I chose the wrong file type association. Text Document I think. I renamed it to have the .js extension which is what I

相关标签:
10条回答
  • 2020-12-23 00:56

    In Settings (or Preferences for mac) > Editor > File Types you can edit patterns by which a file gets associated as some type or other.

    If you select the patterns for a file type you have wrongly selected (in your case Text type) you can remove the filename pattern with which was created to associate you file's filename as a wrong type.

    Then click Apply > OK

    0 讨论(0)
  • 2020-12-23 00:56

    Refer to File -> Settings -> IDE Settings -> File Types

    In right select "Text files" in Reconigzed File Types then find in Registered Patterns your file and click remove your file

    0 讨论(0)
  • 2020-12-23 00:57

    I've found a solution, delete (o rename as .old) the file: C:\Users\.PyCharmCE\config\options\filetypes.xml

    Es: C:\Users\goofy.PyCharmCE2018.3\config\options\filetypes.xml

    0 讨论(0)
  • 2020-12-23 01:02

    I have found in phpstorm that I can use the Refactor > Rename... function to associate a file of unspecified file type (e.g. a name with no extension) with a file type.

    For example if I have a bash script named do_the_things I can Refactor > Rename it to do_the_things.sh which causes it to pick up the bash highlighting, then when I Refactor > Rename it back to do_the_things it keeps the bash highlighting.

    0 讨论(0)
提交回复
热议问题