Skip to content

Commit

Permalink
feat(Editor): Register SQL and PrQL as editor languages
Browse files Browse the repository at this point in the history
  • Loading branch information
nokome committed Sep 9, 2022
1 parent 77e7aab commit c08bd25
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 45 deletions.
71 changes: 26 additions & 45 deletions packages/components/package-lock.json

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

1 change: 1 addition & 0 deletions packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
"@codemirror/lang-markdown": "^0.19.6",
"@codemirror/lang-python": "^0.19.5",
"@codemirror/lang-xml": "^0.19.2",
"@codemirror/lang-sql": "^0.19.4",
"@codemirror/legacy-modes": "^0.19.1",
"@codemirror/matchbrackets": "^0.19.4",
"@codemirror/panel": "^0.19.0",
Expand Down
4 changes: 4 additions & 0 deletions packages/components/src/components/editor/editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,10 @@ export class Editor {
const { markdown } = await import('@codemirror/lang-markdown')
return markdown()
}
case 'sql': {
const { sql } = await import('@codemirror/lang-sql')
return sql()
}
}
}

Expand Down
10 changes: 10 additions & 0 deletions packages/components/src/components/editor/languageUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ export const fileFormatMap: FileFormatMap = {
ext: 'txt',
aliases: ['txt'],
},
PrQL: {
name: 'PrQL',
ext: 'prql',
aliases: ['prql'],
},
Python: {
name: 'Python',
ext: 'py',
Expand All @@ -67,6 +72,11 @@ export const fileFormatMap: FileFormatMap = {
ext: 'rmd',
aliases: ['rmd', 'r markdown', 'rmarkdown'],
},
SQL: {
name: 'SQL',
ext: 'sql',
aliases: ['sql'],
},
TOML: {
name: 'TOML',
ext: 'toml',
Expand Down

0 comments on commit c08bd25

Please sign in to comment.