How to change the file type of a single file?

Answered

Hi!

I created a model using New->File and named it blah.rb. Then I copied the class contents to it. But RubyMine still thinks it is a plain text file. How to change that? I was searching for this basic feature for more than 30 minutes now!

iGEL

7 comments
Comment actions Permalink

Hello Klaus,

Settings | File Types, remove the name of the file from the list of associations
for Plain Text file type.

I created a model using New->File and named it blah.rb. Then I copied

the class contents to it. But RubyMine still thinks it is a plain text
file. How to change that? I was searching for this basic feature for
more than 30 minutes now!


--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


5
Comment actions Permalink

Hi!

Thanks for the answer, now it works. Still I think it's hard to find that solution and I would not expect, that creating a file will change my (global) IDE settings.

Why don't you add a "Change file type" option to the files context menu?

iGEL

4
Comment actions Permalink

Any update on this? 

Why not just select the syntax for a single file? Like in Sublime. Sometimes I have files with extension (Linux script for example, with a shebang) and simply to set the correct syntax would be so much easier...

Since script like this don't need to have an extension). So a generic .cgi extension can almost be any language.

0
Comment actions Permalink

Hello Roger,

there seems to be a usability problem related, please take a look:

https://youtrack.jetbrains.com/issue/RUBY-18277

0
Comment actions Permalink

@olga, thanks that clears is up!

0
Comment actions Permalink

Use case for being able to change the file association on a whim...

I'm using PyCharm to edit a Jinja2 template file.  The file will result in an XML output but the template file has an extension of .j2.

Usually I edit the file as a javascript file.  Sometimes I want to see the file as an XML.  Where's the option to see my file highlighted as an XML when the extension is .j2?  And no, going into preferences to change the association is not a reasonable answer.

Where's the resistance to simply add this very useful feature?

What I do now is bounce out to Sublime...  very tedious.

0
Comment actions Permalink

Chrisjx, we have a corresponding feature request on our tracker so please add your vote there https://youtrack.jetbrains.com/issue/IDEA-113835

0

Please sign in to leave a comment.