Skip to content

Commit 92851ca

Browse files
authored
Revert "build: Upgrade shiki (#446)" (#449)
This reverts commit 579ea31.
1 parent 3cc4fb1 commit 92851ca

File tree

4 files changed

+36
-18
lines changed

4 files changed

+36
-18
lines changed

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,6 @@
192192
"dependencies": {
193193
"@types/vscode": "^1.87.0",
194194
"prql-js": "^0.11.3",
195-
"shiki": "^1.1.7"
195+
"shiki": "^0.14.7"
196196
}
197197
}

src/views/sqlPreview.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
WebviewPanelOnDidChangeViewStateEvent,
1414
Uri,
1515
} from 'vscode';
16+
1617
import * as shiki from 'shiki';
1718

1819
import { readFileSync } from 'node:fs';
@@ -510,7 +511,7 @@ export class SqlPreview {
510511

511512
// create html to display for the generated sql
512513
const highlighter = await this.getHighlighter();
513-
const sqlHtml = highlighter.codeToHtml(sqlCode, { lang: 'sql', theme: this.themeName});
514+
const sqlHtml = highlighter.codeToHtml(sqlCode, { lang: 'sql' });
514515

515516
return { status: 'ok', sqlHtml: sqlHtml, sql: sqlCode };
516517
}
@@ -525,8 +526,7 @@ export class SqlPreview {
525526
return Promise.resolve(this._highlighter);
526527
}
527528
return (this._highlighter = await shiki.getHighlighter({
528-
themes: [this.themeName],
529-
langs: ['sql'],
529+
theme: this.themeName,
530530
}));
531531
}
532532

@@ -540,7 +540,7 @@ export class SqlPreview {
540540
.getConfiguration('workbench')
541541
.get<string>('colorTheme', 'dark-plus'); // default to dark plus
542542

543-
if (colorTheme in shiki.bundledThemes) {
543+
if (shiki.BUNDLED_THEMES.includes(colorTheme as shiki.Theme)) {
544544
return colorTheme;
545545
}
546546

@@ -549,7 +549,7 @@ export class SqlPreview {
549549
.toLowerCase()
550550
.replace('theme', '')
551551
.replace(/\s+/g, '-');
552-
if (colorTheme in shiki.bundledThemes) {
552+
if (shiki.BUNDLED_THEMES.includes(colorTheme as shiki.Theme)) {
553553
return colorTheme;
554554
}
555555

tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"compilerOptions": {
33
"module": "commonjs",
4-
"target": "ES2021",
5-
"lib": ["ES2021", "DOM"],
4+
"target": "es2020",
5+
"lib": ["es2020"],
66
"outDir": "out",
77
"sourceMap": true,
88
"strict": true,

0 commit comments

Comments
 (0)