GoClipse / goclipse

Eclipse IDE for the Go programming language:
http://goclipse.github.io/
Eclipse Public License 1.0
840 stars 287 forks source link

Semantic highlighting in source code #111

Open bruno-medeiros opened 9 years ago

bruno-medeiros commented 9 years ago

Highlight source code according to semantic properties, example:

-function declaration names -type declaration names -variable names

10liuguang01 commented 8 years ago

Come on

rsippl commented 8 years ago

+1

This lacking feature is the only reason that keeps me from switching from IntelliJ Idea.

bruno-medeiros commented 8 years ago

How does the semantic highlighting work in IntelliJ, which semantic elements are highlighted?

rsippl commented 8 years ago

Here's what it looks like:

idea-go-1 idea-go-2 idea-go-3

rsippl commented 8 years ago

Here's the plugin code (not sure if it helps)

bruno-medeiros commented 8 years ago

Yeah, I know about go-lang-idea-plugin already. I'm not sure I quite understand the logic of that highlighting though. Println is a function and is highlighted red, same as RGBA which is a struct. At the same time, the methods ScaleBy and Distance are not highlighted...

sanmai commented 8 years ago

Here's how it looks like in Eclipse's PDT:

highlight (note the cursor position)

rillig commented 8 years ago

IntelliJ knows the following token categories for coloring Go programs:

Some additional categories I find useful are:

When you install IntelliJ, you can find many more token categories in the Settings dialog (Alt+Ctrl+S), section Editor > Colors & Fonts. Note the General section, which has entries for “Unused symbol” and similar things.