Codemirror 6
mraghuram opened this issue · 11 comments
mraghuram commented
Hi, just curious to know if there is a plan to upgrade this to CodeMirror 6.
Thanks for all the amazing stuff so far.
jaywcjlove commented
@mraghuram Wait for the official version to released.
mraghuram commented
Thanks. Looks like final beta is out.
addingama commented
Any update on this?
jaywcjlove commented
@addingama Still waiting...
jaywcjlove commented
Upgrade @uiw/react-codemirror@4.0.0-rc.4
+++
jaywcjlove commented
import CodeMirror from '@uiw/react-codemirror';
- import 'codemirror/mode/javascript/javascript';
+ import { javascript } from "@codemirror/lang-javascript";
const code = 'console.log("hello world!");';
<CodeMirror
value={code}
- options={{
- mode: 'js',
- }}
+ extensions={[
+ javascript({ jsx: true })
+ ]}
/>
gitluck1314 commented
I have not found any language packs that support yaml. Can you help me?
gitluck1314 commented
gitluck1314 commented
@jaywcjlove 我看这个链接,没有发现可以支持yaml的语言包,这是怎么回事呢?我需要你的帮助
jaywcjlove commented
@gitluck1314 https://gitee.com/uiw/react-codemirror
import CodeMirror from '@uiw/react-codemirror';
import { StreamLanguage } from '@codemirror/language';
import { yaml } from '@codemirror/legacy-modes/mode/yaml';
const yamlLang = `yaml......`;
export default function App() {
return (
<CodeMirror
value={yamlLang}
height="200px"
extensions={[StreamLanguage.define(yaml)]}
/>
);
}
ArchanaSharma95 commented
I am getting this error after adding any language extension:: Cannot read properties of null (reading 'extension')