-
-
Notifications
You must be signed in to change notification settings - Fork 274
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to integrate Shiki Highlighter #641
Comments
This is my code, inspired by a demo I saw on GitHub, but I can't locate it now. "use client"; import "@fontsource-variable/fira-code"; const ADDITIONAL_THEMES = [ const ADDITIONAL_LANGUAGES = ["c", "java"] as const satisfies Parameters<
export function CodeEditor() { useEffect(() => { const options = useMemo( const handleEditorMount = async (
}; return ( import { create } from "zustand"; interface CodeEditorState { export const useCodeEditorStore = create((set) => ({ codeEditorStore.ts: interface CodeEditorState { export const useCodeEditorStore = create((set) => ({ It can achieve a good effect by changing the theme using setTheme. I'm currently trying to collect LSPs. If you're doing something similar, could you share some of your experiences with me? |
Describe the bug
I want to integrate Shiki highlighter, but there is a significant delay, and sometimes it doesn't work because I have to make
handleEditorWillMount
into an async functionTo Reproduce
Steps to reproduce the behavior:
But this has a delay so it doesn't work properly. If I save
highlighter
into a state variable, then it doesn't work either.Any workarounds since
createHighlighter
is async?Expected behavior
No delay, full integration
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: