Skip to content

Commit

Permalink
Desktop: CM6 plugin API: Allow importing @codemirror/lang-markdown and
Browse files Browse the repository at this point in the history
`@lezer/highlight`
  • Loading branch information
personalizedrefrigerator committed Jan 19, 2024
1 parent 3ed6ad5 commit 402338e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 8 additions & 3 deletions packages/editor/CodeMirror/pluginApi/codeMirrorRequire.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@ import * as codeMirrorLanguage from '@codemirror/language';
import * as codeMirrorAutocomplete from '@codemirror/autocomplete';
import * as codeMirrorCommands from '@codemirror/commands';
import * as codeMirrorLint from '@codemirror/lint';
import * as codeMirrorLangHtml from '@codemirror/lang-html';
import * as codeMirrorLangMarkdown from '@codemirror/lang-markdown';
import * as codeMirrorLanguageData from '@codemirror/language-data';

import * as lezerHighlight from '@lezer/highlight';
import * as lezerCommon from '@lezer/common';
import * as lezerMarkdown from '@lezer/markdown';
import * as codeMirrorLangHtml from '@codemirror/lang-html';
import * as codeMirrorLanguageData from '@codemirror/language-data';


// Exposes CodeMirror libraries to plugins.
//
Expand All @@ -21,12 +24,14 @@ const libraryNameToPackage: Record<string, any> = {
'@codemirror/language': codeMirrorLanguage,
'@codemirror/autocomplete': codeMirrorAutocomplete,
'@codemirror/commands': codeMirrorCommands,
'@codemirror/highlight': lezerHighlight,
'@codemirror/lint': codeMirrorLint,
'@codemirror/lang-html': codeMirrorLangHtml,
'@codemirror/lang-markdown': codeMirrorLangMarkdown,
'@codemirror/language-data': codeMirrorLanguageData,

'@lezer/common': lezerCommon,
'@lezer/markdown': lezerMarkdown,
'@lezer/highlight': lezerHighlight,
};

const codeMirrorRequire = (library: string) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,11 @@ const externalContentScriptLibraries = [
'@codemirror/highlight',
'@codemirror/lint',
'@codemirror/lang-html',
'@codemirror/lang-markdown',
'@codemirror/language-data',
'@lezer/common',
'@lezer/markdown',
'@lezer/highlight',
];

const extraScriptExternals = {};
Expand Down

0 comments on commit 402338e

Please sign in to comment.