udalov / kotlin-vim

Kotlin plugin for Vim. Featuring: syntax highlighting, basic indentation, Syntastic support
Apache License 2.0
630 stars 52 forks source link

Highlight function, class, interface, type definitions #35

Closed kageru closed 4 years ago

kageru commented 4 years ago

Pictures say more than words, so here is one.

Function/constructor calls aren’t highlighted yet. I would like to add that as well, but that feels like a separate issue to me, and I don’t know if you even want it.

udalov commented 4 years ago

Thanks for the contribution. I feel I might have an unpopular opinion here, but I would prefer to keep this functionality disabled by default (see #30). The reason why I prefer that is because I don't see a clear balance between not highlighting anything, and highlighting all declaration names which would lead to visual clutter.

In particular, it would make sense to also highlight property (val/var) names, since a lot of the times they carry the same meaning as functions. But then... do we want to also highlight local variables? If yes, then a lot more will be highlighted and it would be more difficult to distinguish stuff colored in one way versus the other. If not, then we need to track context in the syntax scheme to distinguish properties from local variables, and that would complicate the syntax plugin a lot.

kageru commented 4 years ago

I see. I’m kind of used to having most things (including function definition and function calls) highlighted for other languages (e.g. rust-vim), but I can see your point, also regarding the complexity of the highlighting rules. Kind of my bad for not going through the open issues to find your previous statements on this.

I guess I’ll keep my fork for personal use, and if and when I have the time and motivation to read about how feature toggles in vim plugins work, I’ll return and address #30.