Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The following parts of a new language support should be considered:

  • recognizing files, File type recognition (so that NetBeans knows they belong to the new language)
  • adding a project Project type, if needed, so that the files can be built, run and debugged
  • adding Sematic syntax highlighting
  • adding code completion and other editor features
  • adding debugger

...

  • Formatting
  • Braces matching, automatic closing of braces
  • Error Hints/Fixes/Suggestions
  • Code completion
  • Code templates
  • Refactoring (e.g. renaming, find usages, go to, etc.) 
  • Debugging

There are a number of ways to add support for a programming language, each one of them having its pros and cons. Historically, these are:

  • JavaCC is the old way
  • ANTLR is the modern way, but it is not easy to keep the many languages up-to-date; there are a number of tutorials on how to create a NB plugin using ANTLR, many outdated, with the best one in the Apache NetBeans book to add a plugin for blockchain support. ANTLR4 grammars.
  • LSP seems to be gaining ground and seems to become the new way. This tutorial is an LSP Client demo to provide support for the (ba)sh language. A list of Textmate syntaxes.

File Type Recognition


Use the New File /Module Developer/Development → File Typewizard. Please note a A MIME type should must be specified - this . This MIME type will be the key under which other services will be looked up. See the File Type Integration Tutorial for more details on how to add File Type recognition support.

Adding Syntax Highlighting

...

Syntax highlighting can be implemented either by writing a lexer module for NetBeans, or by re-using TextMate grammars. Please see the use cases and an example grammar registration for the latter.

Formatting

Adding Code Completion and Other Editor Features

...