Visual Basic highlighting for Kate text editor

0

kate supports syntax highlighting for so many programming languages I was surprised when I couldn't find Visual Basic on the list.

How can I get Visual Basic highlighting on kate?

I know some other text editors support this out of the box (gedit, vi), but I'm not interested on switching.

Related question.

Links about brewing your own syntax highlighting module: One. Two.

EDIT (2017-01-08)

I have found this issue to be reported as a bug, but it has not been addressed by the development team. As the report is quite old, I'm assuming the only alternative is to write the syntax highlighting file myself and submitting it as a patch. https://bugs.kde.org/show_bug.cgi?id=193064

Calculus Knight

Posted 2016-11-13T11:31:53.343

Reputation: 140

I think Specific issues with computer software, hardware or networking (from the super user tour) includes my problem. I fail to see how it's off-topic. If it so, perhaps I can rephrase it. – Calculus Knight – 2016-11-13T18:48:10.163

I certainly hope so. I've edited the question. Hopefully for the best. Let me know if it's not the case. – Calculus Knight – 2016-11-13T20:04:56.663

Less verbose, more to the point. Danks. – Calculus Knight – 2016-11-13T22:41:39.040

Answers

1

What I found by searching for basic word in /home/[username]/.kde/share/apps/katepart when I raised the same question:

  • KBasic - works, but misses a lot
  • PureBasic - similar
  • MonoBasic - I like it!
  • Ti Basic - not suitable for Visual Basic at all
  • FreeBASIC - this one is good too

Good luck!

propcoder

Posted 2016-11-13T11:31:53.343

Reputation: 26

Thank you so much! It seems to me that MonoBasic works best. I use the Dark Breeze theme, so I modified the syntax highlight colour in /configure kate/Editor Component/Fonts & Colors/Highlighting Text Styles to change the Navy Blue to Orange. – Calculus Knight – 2017-02-17T13:12:44.667

1

Syntax highlighting uses a tokenizer for the language, which recognizes elements such as keywords and numbers, and classifies them. Visual Basic has a few ambiguities that require certain tokens to be recognized in different ways depending on context, i.e. it is not a context-free language.

That is why useful syntax highlighting for VB is generally only offered by full IDEs that build a full model of the program that can be used to provide the context.

Most other programming languages get by with a lot less, and/or users accept that certain things are not highlighted properly, for example the names of typedef'd types in C are shown in the same color as variable names, because a pure tokenizer cannot distinguish between them.

Simon Richter

Posted 2016-11-13T11:31:53.343

Reputation: 2 384