Places pattern parameter

Hi all,
I am developing in Javascript a WebGL application, and I installed the GLSL plugin...
now, how I can say to WebStorm that if there is the code

gl.shaderSource(vs, "#ifdef GL_ES\nprecision mediump float;\n#endif\nuniform vec4 color;\n\nvoid main(void)\n{\n\tgl_FragColor = color;\n}\n");

The second parameter is a GLSL code?
I see the Language injections setting, but I have no idea what should I write in the "Places pattern" box...


Hi all,
nobody can help me? It is because places patter are so simple that I should be able to do this my own?


Hi Antonino,

I've captured a screencast about language injection for you.



Hi Fedor,
Many thanks for reply!
Your video seems like I do actually, ALT+RETURN and select "Inject Language" then GLSL then agan ALT+RETURN and finally "Edit GLSL fragment"...

But with settings we can say to editor that every time the fragment is in some conditions is injected language.
For example in the screenshot every href attribute inside xhtml that match the pattern "^javascript:(.+)" is javascript.

In my code I have:

this.constantShader=this.GetProgram("attribute vec3 aVertexPosition;\nuniform mat4 uPVMatrix;\n\nvoid main(void)\n{\n\tgl_Position = uPVMatrix * vec4(aVertexPosition, 1.0);\n}\n",
    "#ifdef GL_ES\nprecision mediump float;\n#endif\nuniform vec3 color;\n\nvoid main(void)\n{\n\tgl_FragColor = vec4(color,1.0);\n}\n");

Theorically I can say that the parameters of GetProgram are GLSL... But I have no idea how fill "places pattern".

Anyway thanks,


Hi all,
nobody can help me? It is because places patter are so simple that I should be able to do this my own?

Sorry for delay. The patterns aren't simple.
It is platform internals being exposed in generic case. The UI is completely not-user-friendly.
Though it has some completion if you have Groovy plugin installed.

Try something like this:

+ jsLiteralExpression().and(jsArgument("shaderSource", 1))

Screen Shot 2013-09-16 at 5.23.07 PM.png

It works!

thank you very much!
It is impossible imagine it.

Please sign in to leave a comment.