PhpStorm shows Haml file like plain text (transcompilation works, but not the syntax highlighting) - haml

The syntax highlighting for my haml files in PhpStorm does not work, and the icon is just the icon for plain text. (It should be a red icon with an h, similar to the icon for the scss file.)
The transcompilation works only if File type in the watcher is set to Text files. If I choose HAML files, it tells me that there are "No such files in scope".
Any ideas, why PhpStorm recognizes the scss file, but not the haml file?

First of all -- make sure that HAML support plugin is installed and enabled (whould be by default).
If plugin is good:
Settings | File Types
Text files entry
Find and remove offending pattern (quite possible will be background-clip.haml or similar)

Related

IntelliJ IDEA JSX code style

I have a JSX file with two-space indents, but IntelliJ keeps adding four-space indents. Changing Settings>Editor>Code Style for Javascript, HTML, and "other file types" does not seem to affect this.
How can I change the code style for JSX files?
Turns out the reason the IDE wasn't responding to my settings changes is it was using EditorConfig mode (Settings>Editor>Code Style>EditorConfig). Editing the .editorconfig file to have the line indent_size = 2 fixed the issue.

WebStorm Smarty highlighting

Is there an way to make WebStorm highlight Smarty templates? Either through plugin or some other means?
Also note, I need this for WebStorm, not PhpStorm or some other version; I don't need autocomplete or anything else -- just highlights.
Files have .tpl extension and so far I'm treating them as HTML files and I am looking for options to increase code readability with coloring.
I have tried following based on the comments:
However, resulting .tpl file still looks like

Webstorm not recognising JavaScript file

Webstorm doesn't recognize one of my .js files as a JavaScript file so I'm losing syntax highlighting and being able to add break points. I've looked in the workspace.xml file and the file in question seems to have similar settings to other .js files that work correctly.
If I change the name of the file it works ok. So somehow Webstorm is stuck on misinterpreting the type of a file that has this name. Where else can I edit the project?
So I see three possible reasons for the problem:
The file was marked as 'Plain text'
There is a pattern for 'Text files' file type that matches this file (or back: file type 'JavaScript' exclude this file name). See image below
There is a custom plugin that overrides default behavior for files with this name (unlikely)
Updated: after several years I've found one more reason for the behavior and most likely it the main source of the issues. When you create a file without any extensions the "Register New File Type Association" is appeared. And you can accidentally specify a new file type, for some file name. It is can be fixed with (2) but it is the reason why the pattern was added there.
Note: the solution works for all IDEA-based IDEs: IntelliJ IDEA, WebStorm, RubyMine, PyCharm, PhpStorm.
File -> Settings -> Editor -> FileTypes -> Text files -> check for "ContentRepository.js" pattern there and remove it.
If the file was marked as "Plain Text", then this can be fixed as follows:
Right click on the file.
One of the menu options is "Mark as Javascript" . Just below "Delete".
Click that. Your file is now recognized as javascript by WebStorm.
Since WebStorm was not allowing screenshots after right click so couldn't add it here.
My problem was with Auto-detect file type by context
For me this did the trick
1) Preferences
2) Editor
3) FileTypes
4) Search for javascript
5) Add *.js to registered patterns
You can also try "Template data languages" (in file > settings) which will force a specific language synatax high-lighting on a specific file or folder. See screenshot below
For a block of code you can also use "language injection". Simply high-light the block of code, wait for the little lamp to appear then select the bottom choice and then the language you need (screenshot also attached)
In case it is helpful elsewhere (OMG this was scary).
For some reason IntelliJ was not recognizing any .js file in my project (even after .idea removal (rm -rf .idea)).
I went to Webstorm (in my case RubyMine): Webstorm > Preferences ... > Editor > File Types then went to Recognized Filed Types, picked Javascript (but whatever file type you are missing will do), then added back a Registered Patterns entry of *.js
Of course, press Apply and then Ok.
Wow, scary stuff. but solved my problem, hope it does for someone else.
I was always trying to add .js as a recognised file types, but somehow .js was added to Ignored Files and Folders.
I just removed .js from Ignored Files and Folders and it worked for me.
Preferences
Editor
FileTypes
Ignored Files and Folders
Remove *.js
2022 update!
Right click on file and choose JavaScript

Intellij Idea how can I specify colors for a specific file type?

I am using a color theme that I am perfectly happy with, but I am dealing with a lot of ".impex" files that are unique to the Hybris platform. The IDE essentially sees them as text files. How can I add syntax coloring to these ".impex" files so the text is not just all one color?
Maybe this plugin can help you.
Syntax highlight for impex files
Besides, you can register a file pattern to a recognised file type: Preferences -> IDE Settings -> File Types.

IntelliJ idea - any way to change visual line wrapping icon?

I really like Intellij's line wrapping feature with icons marking line wraps. Hovewer the default wrapping icon's readability is far from ideal.. is there any way I could fix this little problem?
Current solution is to use standard unicode symbols from supplementary arrows set: 2925 and 2926.
You can modify that by specifying other unicode (hex) codes via idea.editor.wrap.soft.before.code and idea.editor.wrap.soft.after.code properties in idea.properties file. Note that it's necessary to define both symbols, e.g. add to the idea.properties something like below:
idea.editor.wrap.soft.before.code=2906
idea.editor.wrap.soft.after.code=2907
Note that not all the fonts contain all the Unicode characters, so you have to choose the proper font in Settings | Editor | Colors & Fonts and specify the symbol code that exists in the font that you are using.
To clarify what CrazyCoder said:
On a Mac, you'll need to go into finder and "show package contents" on the Intellij IDEA.app, then you can add lines to the idea.properties file in the "bin" folder. Here's the arrow codes I went with:
idea.editor.wrap.soft.before.code=219e
idea.editor.wrap.soft.after.code=21a0
Don't forget, you can also change their color in the program's preferences under "editor > colors and fonts > general > soft wrap sign".