mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-16 16:14:43 -04:00
feat(editor): add basic codemirror autocompletion suggestions
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
This commit is contained in:
parent
4956a99ced
commit
61032cb745
23 changed files with 284 additions and 2 deletions
|
@ -4,9 +4,14 @@
|
|||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import type { CheatsheetExtension } from '../../../components/editor-page/cheatsheet/cheatsheet-extension'
|
||||
import {
|
||||
basicCompletion,
|
||||
codeFenceRegex
|
||||
} from '../../../components/editor-page/editor-pane/autocompletions/basic-completion'
|
||||
import type { MarkdownRendererExtension } from '../../../components/markdown-renderer/extensions/base/markdown-renderer-extension'
|
||||
import { AppExtension } from '../../base/app-extension'
|
||||
import { AbcjsMarkdownExtension } from './abcjs-markdown-extension'
|
||||
import type { CompletionSource } from '@codemirror/autocomplete'
|
||||
|
||||
export class AbcjsAppExtension extends AppExtension {
|
||||
buildMarkdownRendererExtensions(): MarkdownRendererExtension[] {
|
||||
|
@ -16,4 +21,8 @@ export class AbcjsAppExtension extends AppExtension {
|
|||
buildCheatsheetExtensions(): CheatsheetExtension[] {
|
||||
return [{ i18nKey: 'abcjs', categoryI18nKey: 'charts', readMoreUrl: new URL('https://www.abcjs.net/') }]
|
||||
}
|
||||
|
||||
buildAutocompletion(): CompletionSource[] {
|
||||
return [basicCompletion(codeFenceRegex, '```abc\n\n```')]
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue