imzbf / md-editor-v3

Markdown editor for vue3, developed in jsx and typescript, dark theme、beautify content by prettier、render articles directly、paste or clip the picture and upload it...
https://imzbf.github.io/md-editor-v3
MIT License
1.63k stars 156 forks source link

Disable default Completion #604

Closed guidu42 closed 3 months ago

guidu42 commented 3 months ago

Describe the issue

Hello, I'm working on a chat project. For multiple reasons i decided to use md-editor-v3 with Vue for writting messages.

My users won't specially need to use all the default completions that are defined in the set up of MdEditor. When i try to override codeMirrorExtensions like this, i got an error because the override key for codeMirrorExtensions is already called during the set up.

config({
    codeMirrorExtensions(_theme, extensions) {
        return [
            ...extensions,
            autocompletion({
                override: [],
            }),
        ]
    },
})

Could it be possible to override the defaultCompletion defined in packages/MdEditor/layouts/Content/codemirror /autocompletion.ts

Procedure version

Node v16.20.

Reproduction link

No response

imzbf commented 3 months ago

By following this approach, it can be resolved

config({
  codeMirrorExtensions(theme, _extensions, keyBindings) {
    const extensions = [..._extensions];
    // remove completions extension
    extensions.pop();
    return extensions;
  },
});