Versions Compared

Key

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

...

To add support for language-specific features like code completion, navigation, etc. you need the help of a Language Protocol Server.  Again, follow the instructions provided in LSP Client demo - (ba)sh language server tutorial. One needs to tell NetBeans to download the LSP binary the first time the user opens a file of the language and to add support for it using the new LSP API provided by NetBeans.

How to add LSP support

Assuming you have download the LSP for your language (as it will be described in the next section), one needs to:

...

Utils helper class will provide the location of the download downloaded LSP file.

public final class Utils {

...

A list of Language Server implementations and another list of Language Server Implementations. For example, to add support for Kotlin programming language, you need to download kotlin-lkotlin-language-serveranguage-server.

A thread that is executed @OnStart

...

More changes are needed. The interested reader can study java/kotlin.editor and nb/updatecenters/extras/libs.kotlin.lsp modules for more detailsinformation.

Open the source file again and try code completion, formatting, navigation (e.g. jump to definition, peek definition), find all references, symbol search etc.

...

See Adding New Language Support.

9. Refactoring

See Adding New Language Support.

10. Error squiggles and apply suggestions from errors

...