Skip to content

Commit 29864f1

Browse files
committed
chore(devtools): fix deprecation
1 parent 3f168cc commit 29864f1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

client/composables/shiki.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import type { Highlighter, Lang } from 'shiki'
2-
import { getHighlighter } from 'shiki'
1+
import type { Highlighter, BundledLanguage } from 'shiki'
2+
import { createHighlighter } from 'shiki'
33
import { computed, ref, toValue } from 'vue'
44
import type { MaybeRef } from '@vueuse/core'
55
import { devtools } from './rpc'
@@ -8,7 +8,7 @@ export const shiki = ref<Highlighter>()
88

99
export function loadShiki() {
1010
// Only loading when needed
11-
return getHighlighter({
11+
return createHighlighter({
1212
themes: [
1313
'vitesse-dark',
1414
'vitesse-light',
@@ -28,7 +28,7 @@ export function loadShiki() {
2828
})
2929
}
3030

31-
export function renderCodeHighlight(code: MaybeRef<string>, lang?: Lang) {
31+
export function renderCodeHighlight(code: MaybeRef<string>, lang: BundledLanguage) {
3232
return computed(() => {
3333
const colorMode = devtools.value?.colorMode || 'light'
3434
return shiki.value!.codeToHtml(toValue(code), {

0 commit comments

Comments
 (0)