SQL file type?

I have a bunch of sql files in a new project. I was surprised that, upon opening them, there is no flavor recognition. No syntax highlighting, intellisense, etc.

The specific dialect is oracle: but even the ansi-compliant sql are completely ignored.

What do I need to do here?



Edited by: Stephen Boesch on Apr 19, 2008 11:50 PM


I just saw that "Sql Support" is a new feature coming in Ij8. So apparently it really is not supported in ij7.

But, is there a plugin out there for it? I just want some sql syntax highlighting.

Also, in IJ is there a concept of a syntax file, like in Editplus? If so then I could roll my own syntax highlighter.

steve b


fyi for all those faithful readers ..

There is a File | Settings | File Types.

I added a new one for SQL and registered it for association with *.sql files. It does the syntax highlighting. took abt 5 minutes to set it up including keywords


I found answer myself -- sql not explicitly supported until IJ8. But I also added my own SQL file type and entered a few dozen keywords. That's enough for now.


Check out the IJ plugins site. You may find some useful things there... :)
http://plugins.intellij.net/plugin/?id=262 if you need only code highlighting
http://plugins.intellij.net/category/?category_id=45 if you need more complex things


Hi Dan,
I gave you some point ;)

I downloaded your plugin and built from source.

Question: I am using jdk6 and IJ7. I got two problems with that.

1. In the file IdentifierPsiElement, three methods needed to be implemented to satisfy the interfaces.

/* Following methods were not implemented */

public T getUserData(Key tKey) { return null; } public void putUserData(Key]]> tKey, T t) {

public Icon getIcon(int i) {
return null;

/* End unimplemented methods */

2. After that everything built, but got a message Error: Wrong JDK type for plugin module DBNavigator.


Hi Stephen,

why do you need to build the plugin from source? You can take the already built distribution archive if you only want to use its functionality. You can either install it manually by extracting the .zip in the IJ plugins directory, or you can use the plugin manager to automatically install the plugin in your ide (IJ Settings >> IDE Settings >> Plugins).

The methods you mention are already implemented in the ASTWrapperPsiElement. If they appear as not implemented, there is something wrong with the jdk you selected for the plugin project. It must be the "IntelliJ IDEA SDK 7.0.x" with JDK6. This may be the explanation for the "Wrong JDK type for plugin module DBNavigator" message.

Best regards,


Please sign in to leave a comment.