custom language plugin

 hey guys,

I decided to make a plugin for the css-like language following this instruction but im not sure i understand how to add new language class to the sources. i created new java class and didnt find where extend it from class com.intellij.lang.Language doesnt exist. Also the empty project doesnt start. Please help)) im noob in intellij and java.

Official comment

`com.intellij.lang.Language` is part of SDK that you should configure as it's said at

After that, you should create an IntelliJ IDEA Plugin project and set created SDK for it.

You share attach `.idea` directory of your project, so I'll tell you what exactly is wrong with it.

thanks, idea has been compiled. where should i put <fileTypeFactory implementation="com.simpleplugin.SimpleFileTypeFactory"/> ? is this some xml?


Yes, there is plugin.xml file that is generated on creating project


Thanks, i have added it to the plugin.xml, but my file extension is still not suppoting... could you please review the code at Also the @override,  Icon and String classes are highlighting with red in the editor, maybe you know the reason? thanks.


First of all, your extension IS supported. How did you decide that it isn't?

In the second, there is an exception in log:


ERROR: Icon cannot be found in 'icons/jar-gray.png', aClass='class ussPlugin.UssIcons'
at com.intellij.openapi.diagnostic.Logger.error(
at com.intellij.openapi.util.IconLoader.getIcon(
at com.intellij.openapi.util.IconLoader.getIcon(
at ussPlugin.UssIcons.<clinit>(
at ussPlugin.UssFileType.getIcon(
at com.intellij.ide.presentation.VirtualFilePresentation.getIconImpl(
at com.intellij.util.IconUtil.getIcon(
at com.intellij.openapi.fileEditor.impl.EditorWindow.getFileIcon(
at com.intellij.openapi.fileEditor.impl.EditorWindow.updateFileIcon(
at com.intellij.openapi.fileEditor.impl.EditorsSplitters.updateFileIconImmediately(
at com.intellij.openapi.fileEditor.impl.EditorsSplitters.lambda$updateFileIconLater$2(
at com.intellij.util.concurrency.QueueProcessor.runSafely(
at com.intellij.util.Alarm$Request$
at com.intellij.openapi.application.TransactionGuardImpl$
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.runNextEvent(
at com.intellij.openapi.application.impl.LaterInvocator$
at java.awt.event.InvocationEvent.dispatch(
at java.awt.EventQueue.dispatchEventImpl(
at java.awt.EventQueue.access$500(
at java.awt.EventQueue$
at java.awt.EventQueue$
at Method)
at java.awt.EventQueue.dispatchEvent(
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(
at com.intellij.ide.IdeEventQueue._dispatchEvent(
at com.intellij.ide.IdeEventQueue.dispatchEvent(
at java.awt.EventDispatchThread.pumpOneEventForFilters(
at java.awt.EventDispatchThread.pumpEventsForFilter(
at java.awt.EventDispatchThread.pumpEventsForHierarchy(
at java.awt.EventDispatchThread.pumpEvents(
at java.awt.EventDispatchThread.pumpEvents(

Which brings us to incorrect `IconLoader.getIcon` call. The '/' is missing at the start.


sorry, i havent got such exception on executing my plugin. maybe i didnt configure sdks in the right way,but i did it just like in the tutorial.


The question is still valid.

> First of all, your extension IS supported. How did you decide that it isn't?


> i did it just like in the tutorial.

As I said, you didn't. Have you tried the solution I've suggested?


i decided so because icon near my file hasnt been changed. and yes, i tried your solution. 


It's better to check whether the new file type is appeared in Settings | Editor | File types.

Anyway, the source code is completely correct and works. If you provide more info on how you compile and run the plugin and check whether it works, maybe I can help with this.


Some classes and override instructions cannot be resolved by the editor. Maybe this is a reason?

Also can send you screenshots of my project settings. Could you tell me which of them do you need? Sorry for inconvience. 

File type doesnt appear in the file types folder



> Some classes and override instructions cannot be resolved by the editor. Maybe this is a reason?


It is, for sure. But how did you run debug IDE instance if you cannot compile the project?


Anyway, just check 'File | Project Structure | SDKs | IntelliJ IDEA Community... | Internal Java Platform ', it should point to your JDK.


the project compiles and runs ok, though these classes are highlighted red

this is my project sdk structure

and this is my jdk




I have no idea why JDK-classes is highlighted, but since the project is compiled and run, I don't see how it can affect anything. You can try invoke 'File | Invalidate Caches' though.

As for adding a file type, the project at is configured right and works fine for me.

You can attach logs (Help | Show Log), maybe there is something suspicious. If not, I can suggest only recreate JDK and IDEA SDK and project.


Please sign in to leave a comment.