Skip to content

Commit

Permalink
Merge pull request #333 from riccardoperra/fix/new-languages-xml-json
Browse files Browse the repository at this point in the history
feat(config): add xml and json language support
  • Loading branch information
riccardoperra authored Aug 21, 2022
2 parents 4f7b321 + 6a16eed commit e077e50
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 6 deletions.
11 changes: 6 additions & 5 deletions packages/config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@
"@codeimage/highlight": "workspace:*",
"@codemirror/autocomplete": "^6.0.3",
"@codemirror/commands": "^6.0.1",
"@codemirror/language": "^6.2.0",
"@codemirror/lint": "^6.0.0",
"@codemirror/search": "^6.0.0",
"@codemirror/lang-cpp": "^6.0.1",
"@codemirror/lang-css": "^6.0.0",
"@codemirror/lang-html": "^6.1.0",
Expand All @@ -42,17 +39,21 @@
"@codemirror/lang-python": "^6.0.0",
"@codemirror/lang-rust": "^6.0.0",
"@codemirror/lang-sql": "^6.0.0",
"@codemirror/lang-xml": "6.0.0",
"@codemirror/language": "^6.2.0",
"@codemirror/legacy-modes": "^6.1.0",
"@codemirror/lint": "^6.0.0",
"@codemirror/search": "^6.0.0",
"@codemirror/state": "^6.1.0",
"@codemirror/view": "^6.0.2",
"@codemirror/legacy-modes": "^6.1.0",
"material-icon-theme": "^4.19.0",
"solid-js": "^1.4.6"
},
"peerDependencies": {
"@codeimage/highlight": "workspace:*",
"@codemirror/language": "^6.2.0",
"@codemirror/state": "^6.1.0",
"@codemirror/view": "^6.0.2",
"@codemirror/language": "^6.2.0",
"solid-js": "^1.4.6"
},
"devDependencies": {
Expand Down
35 changes: 34 additions & 1 deletion packages/config/src/lib/base/languages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -341,10 +341,43 @@ export const SUPPORTED_LANGUAGES: readonly LanguageDefinition[] = [
},
],
},
{
id: 'xml',
label: 'XML',
plugin: () => import('@codemirror/lang-xml').then(({xml}) => xml()),
icons: [
{
name: 'xml',
extension: '.xml',
content: () => import('material-icon-theme/icons/xml.svg?raw'),
matcher: /^.*\.(xml)$/,
},
],
},
{
id: 'json',
label: 'JSON',
plugin: () => import('@codemirror/lang-json').then(({json}) => json()),
icons: [
{
name: 'json',
extension: '.json',
content: () => import('material-icon-theme/icons/json.svg?raw'),
matcher: /^.*\.(json)$/,
},
],
},
{
id: 'sql',
label: 'SQL',
plugin: () => import('@codemirror/lang-sql').then(({sql}) => sql()),
icons: [],
icons: [
{
name: 'sql',
extension: '.sql',
content: () => import('material-icon-theme/icons/database.svg?raw'),
matcher: /^.*\.(sql)$/,
},
],
},
];
19 changes: 19 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e077e50

Please sign in to comment.