Skip to content

Commit c08bd25

Browse files
committed
feat(Editor): Register SQL and PrQL as editor languages
1 parent 77e7aab commit c08bd25

File tree

4 files changed

+41
-45
lines changed

4 files changed

+41
-45
lines changed

packages/components/package-lock.json

Lines changed: 26 additions & 45 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/components/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
"@codemirror/lang-markdown": "^0.19.6",
7676
"@codemirror/lang-python": "^0.19.5",
7777
"@codemirror/lang-xml": "^0.19.2",
78+
"@codemirror/lang-sql": "^0.19.4",
7879
"@codemirror/legacy-modes": "^0.19.1",
7980
"@codemirror/matchbrackets": "^0.19.4",
8081
"@codemirror/panel": "^0.19.0",

packages/components/src/components/editor/editor.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,10 @@ export class Editor {
265265
const { markdown } = await import('@codemirror/lang-markdown')
266266
return markdown()
267267
}
268+
case 'sql': {
269+
const { sql } = await import('@codemirror/lang-sql')
270+
return sql()
271+
}
268272
}
269273
}
270274

packages/components/src/components/editor/languageUtils.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ export const fileFormatMap: FileFormatMap = {
5252
ext: 'txt',
5353
aliases: ['txt'],
5454
},
55+
PrQL: {
56+
name: 'PrQL',
57+
ext: 'prql',
58+
aliases: ['prql'],
59+
},
5560
Python: {
5661
name: 'Python',
5762
ext: 'py',
@@ -67,6 +72,11 @@ export const fileFormatMap: FileFormatMap = {
6772
ext: 'rmd',
6873
aliases: ['rmd', 'r markdown', 'rmarkdown'],
6974
},
75+
SQL: {
76+
name: 'SQL',
77+
ext: 'sql',
78+
aliases: ['sql'],
79+
},
7080
TOML: {
7181
name: 'TOML',
7282
ext: 'toml',

0 commit comments

Comments
 (0)