sdk icon indicating copy to clipboard operation
sdk copied to clipboard

GLSL: Support Brace Matching and Identing (Syntax Highlighting)

Open grizeldi opened this issue 8 years ago • 8 comments

As it stands, working with glsl .vert and .frag files inside the sdk is a nightmare. There's no syntax highlighting (let alone code completion) and indents are a mess. Every time you press enter your new line will start with 0 indents. Not having auto completion for brackets and curly braces is annoying too. A lot of those problems (but not all of them) can be fixed by installing some third party netbeans plugin, but shaders are a very important thing and I think we should be supporting them by default.

grizeldi avatar Jan 10 '18 16:01 grizeldi

There is a glsl plugin for netbens afaik http://plugins.netbeans.org/plugin/46515/glsl-syntax-highlighter I used it when I was using the sdk and it works fine.

Nehon avatar Jan 10 '18 16:01 Nehon

Yeah I am using that too. However my point is that this is one of the things we should be supporting out of the box (the other being gradle build), but we don't. The plugin doesn't provide a fix for indents or brace autocompletion issue. It just adds syntax highlighting, which makes work easier, but the other problems are still very annoying.

grizeldi avatar Jan 10 '18 16:01 grizeldi

The Problem here is that:

  • I don't know certainly how to add/remove modules from the SDK (I've not found a way to remove nifty without just deleting it).
  • We can't just distribute that plugin, since it's licensed as GPLv3. We would need to write a similar plugin. I know that's a bummer but can't change it there.

A custom plugin would be nice though, since it can also autocomplete jme-isms (all the uniform names). So let's take this issue as the starting point:

Everyone is free to give this a try.

I've looked into GLSL Plugins early (1-2 years ago), there is good documentation about custom syntax highlighting. Darkmonkey actually already provides color schemes for that, one just needs the lexer part. I think this should be in a separate repo though, you can also test this with stock netbeans probably.

MeFisto94 avatar Jan 12 '18 14:01 MeFisto94

No real point in making this separate from sdk IMO since everyone else can use the existing plugin.

grizeldi avatar Jan 12 '18 14:01 grizeldi

Work started here: https://github.com/grizeldi/sdk/tree/glsl Note though that this is my first time working with netbeans, so I'm learning as I go.

grizeldi avatar Jan 15 '18 18:01 grizeldi

@grizeldi Is there anything missing actually?

MeFisto94 avatar Sep 10 '20 21:09 MeFisto94

It's been a while, but iirc syntax highlighting should work. Indents and braces are still a pain though.

grizeldi avatar Sep 11 '20 15:09 grizeldi

Okay, then I'll only rename/rephase this issue, to clearly point out that we could enhance the existing module with brace matching, idents and stuff :)

MeFisto94 avatar Sep 11 '20 15:09 MeFisto94