Solution for Extensionless Files?

Ubuntu 18.04

PHPStorm 2018.3.5 build 183.5912.26

I have been searching for a while and other threads aren't offering any solutions (save one which gives up before trying. :-) )

I have a legacy project that has tons of extensionless files interpreted as PHP. Like most legacy projects, this cannot be changed.

I discovered I can go to Settings->Editor->File Types->PHP and just add * for file type and that fixes it, all the IDE color/highlighting works, all the functionality and linters, perfect.

But like many solutions, the solve creates a bigger problem. Other types are affected (not all, just some.) For example Javascript files with valid .js extensions are interpreted as text, just black text with no IDE functionality.

Is there a workaround or a reasonable way to approach this? I tried a few regex's (in spite of it saying right there " * and ? are supported",)  doesn't work.

I suppose if I'm stuck with turning it on as needed I can do that, just hoping someone has encountered this and arrived at a solution.

 

0
3 comments

In version 2019.1 you can right click a file and use Associate File with... option. This would add a file name (case sensitive) to File | Settings | Editor | File Types to a corresponding pattern.

You might try to do it manually on 2018.3.5.

0

Thank you, unfortunately we have no idea in advance what the file name will be. There are hundreds of them.

0

There are no other solutions for this other than those above, unfortunately.

0

Please sign in to leave a comment.