@codemirror/autocomplete

esm cjs
Autocompletion for the CodeMirror code editor
Version 6.18.6 License MIT
Keywords
editorcode
INSTALL
Type:
Version:
- Static
- Latest Patch
- Latest Minor
- Latest Major
- 6.18.6
- 6.18.5
- 6.18.4
- 6.18.3
- 6.18.2
- 6.18.1
- 6.18.0
- 6.17.0
- 6.16.3
- 6.16.2
- 6.16.1
- 6.16.0
- 6.15.0
- 6.14.0
- 6.13.0
- 6.12.0
- 6.11.1
- 6.11.0
- 6.10.2
- 6.10.1
- 6.10.0
- 6.9.2
- 6.9.1
- 6.9.0
- 6.8.1
- 6.8.0
- 6.7.1
- 6.7.0
- 6.6.1
- 6.6.0
- 6.5.1
- 6.5.0
- 6.4.2
- 6.4.1
- 6.4.0
- 6.3.4
- 6.3.3
- 6.3.2
- 6.3.1
- 6.3.0
- 6.2.0
- 6.1.1
- 6.1.0
- 6.0.4
- 6.0.3
- 6.0.2
- 6.0.1
- 6.0.0
- 0.20.3
- 0.20.2
- 0.20.1
- 0.20.0
- 0.19.15
- 0.19.14
- 0.19.13
- 0.19.12
- 0.19.11
- 0.19.10
- 0.19.9
- 0.19.8
- 0.19.7
- 0.19.6
- 0.19.5
- 0.19.4
- 0.19.3
- 0.19.2
- 0.19.1
- 0.19.0
- 0.18.8
- 0.18.7
- 0.18.6
- 0.18.5
- 0.18.4
- 0.18.3
- 0.18.2
- 0.18.1
- 0.18.0
- 0.17.4
- 0.17.3
- 0.17.2
- 0.17.1
- 0.17.0
<script type="module"> import codemirrorautocomplete from 'https://cdn.jsdelivr.net/npm/@codemirror/autocomplete@6.18.6/+esm' </script>
@codemirror/autocomplete 
[ WEBSITE | DOCS | ISSUES | FORUM | CHANGELOG ]
This package implements autocompletion for the CodeMirror code editor.
The project page has more information, a number of examples and the documentation.
This code is released under an MIT license.
We aim to be an inclusive, welcoming community. To make that explicit, we have a code of conduct that applies to communication around the project.
Usage
import {EditorView} from "@codemirror/view"
import {autocompletion} from "@codemirror/autocomplete"
import {jsonLanguage} from "@codemirror/lang-json"
const view = new EditorView({
parent: document.body,
extensions: [
jsonLanguage,
autocompletion(),
jsonLanguage.data.of({
autocomplete: ["id", "name", "address"]
})
]
})
This configuration will just complete the given words anywhere in JSON context. Most language modules come with more refined autocompletion built-in, but you can also write your own custom autocompletion sources and associate them with your language this way.