Add option to turn it on/off

This commit is contained in:
2023-10-29 23:09:09 +01:00
parent a105028f10
commit 32368f73ca
7 changed files with 39 additions and 11 deletions

View File

@ -37,7 +37,7 @@ import { inlineHoveringTips } from "./documentation/inlineHelp";
import { toposCompletions } from "./documentation/inlineHelp";
import { javascriptLanguage } from "@codemirror/lang-javascript"
const jsCompletions = javascriptLanguage.data.of({
export const jsCompletions = javascriptLanguage.data.of({
autocomplete: toposCompletions
})
@ -53,7 +53,6 @@ export const editorSetup: Extension = (() => [
bracketMatching(),
closeBrackets(),
autocompletion(),
jsCompletions,
highlightActiveLine(),
highlightSelectionMatches(),
keymap.of([
@ -67,6 +66,7 @@ export const editorSetup: Extension = (() => [
export const installEditor = (app: Editor) => {
app.vimModeCompartment = new Compartment();
app.hoveringCompartment = new Compartment();
app.completionsCompartment = new Compartment();
app.withLineNumbers = new Compartment();
app.chosenLanguage = new Compartment();
app.fontSize = new Compartment();
@ -91,6 +91,7 @@ export const installEditor = (app: Editor) => {
app.withLineNumbers.of(lines),
app.fontSize.of(fontModif),
app.hoveringCompartment.of(app.settings.tips ? inlineHoveringTips : []),
app.completionsCompartment.of(app.settings.completions ? jsCompletions : []),
editorSetup,
toposTheme,
app.chosenLanguage.of(javascript()),