You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Next »

To get started, reuse an existing Textmate grammar. This tutorial is an LSP Client demo to provide support for the (ba)sh language.

Adding more advanced support for a new language may consist of several parts, and may be time consuming.

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

  • File type recognition (so that NetBeans knows they belong to the new language)
  • Project type, if needed, so that the files can be built, run and debugged
  • Sematic syntax highlighting
  • 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:

File Type Recognition


Use the New File → Module Development → File Type wizard. A MIME type must be specified. 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


These can be done either by writing them against NetBeans APIs, or by delegating to an LSP Server. Please see Typescript LSP server integration for the latter.


  • No labels