feat: implement base autocomplete implementation for codemirror along with preRequest autocompletion

This commit is contained in:
Andrew Bastin
2021-09-07 22:12:38 +05:30
committed by liyasthomas
parent dc5f52cc0d
commit b9fc0175e7
4 changed files with 105 additions and 0 deletions

View File

@@ -8,6 +8,7 @@ import "codemirror/mode/javascript/javascript"
import { ref, watch } from "@nuxtjs/composition-api"
import { useCodemirror } from "~/helpers/editor/codemirror"
import { LinterDefinition } from "~/helpers/editor/linting/linter"
import { Completer } from "~/helpers/editor/completion"
const props = withDefaults(
defineProps<{
@@ -16,11 +17,13 @@ const props = withDefaults(
placeholder?: string
wrap?: boolean
linter: LinterDefinition | null
completer: Completer | null
}>(),
{
placeholder: "",
wrap: true,
linter: null as any,
completer: null as any,
}
)
@@ -45,5 +48,6 @@ useCodemirror(editor, value, {
lineWrapping: props.wrap,
},
linter: props.linter,
completer: props.completer,
})
</script>