<!-- NOTE: README.md is generated from src/README.md -->

# @codemirror/lang-java [![NPM version](https://img.shields.io/npm/v/@codemirror/lang-java.svg)](https://www.npmjs.org/package/@codemirror/lang-java)

[ [**WEBSITE**](https://codemirror.net/) | [**ISSUES**](https://github.com/codemirror/dev/issues) | [**FORUM**](https://discuss.codemirror.net/c/next/) | [**CHANGELOG**](https://github.com/codemirror/lang-java/blob/main/CHANGELOG.md) ]

This package implements Java language support for the
[CodeMirror](https://codemirror.net/) code editor.

The [project page](https://codemirror.net/) has more information, a
number of [examples](https://codemirror.net/examples/) and the
[documentation](https://codemirror.net/docs/).

This code is released under an
[MIT license](https://github.com/codemirror/lang-java/tree/main/LICENSE).

We aim to be an inclusive, welcoming community. To make that explicit,
we have a [code of
conduct](http://contributor-covenant.org/version/1/1/0/) that applies
to communication around the project.

## Usage

```javascript
import {EditorView, basicSetup} from "codemirror"
import {java} from "@codemirror/lang-java"

const view = new EditorView({
  parent: document.body,
  doc: `public static void main(String[] args) {}`,
  extensions: [basicSetup, java()]
})
```

## API Reference

<dl>
<dt id="user-content-java">
  <code><strong><a href="#user-content-java">java</a></strong>() → <a href="https://codemirror.net/docs/ref#language.LanguageSupport">LanguageSupport</a></code></dt>

<dd><p>Java language support.</p>
</dd>
<dt id="user-content-javalanguage">
  <code><strong><a href="#user-content-javalanguage">javaLanguage</a></strong>: <a href="https://codemirror.net/docs/ref#language.LRLanguage">LRLanguage</a></code></dt>

<dd><p>A language provider based on the <a href="https://github.com/lezer-parser/java">Lezer Java
parser</a>, extended with
highlighting and indentation information.</p>
</dd>
</dl>
