Shawn
Shawn
Molecule 是基于 React 开发的,编辑器功能是基于 Monaco Editor 实现,Vue 生态也有一些基于 Monaco Editor 实现的开源项目,但和 Molecule 类似的目前貌似没有看到。
是 1.x 版本吗?
对于monaco-editor内置支持的语言,除了要在`monaco-editor-webpack-plugin`插件中指定,还需要在打开编辑器时指定文件的language,要注意下language不能写错,例如js要写javascript,可以参考这里的实现方式:https://github.com/DTStack/molecule/blob/69e4f3bc8b6f2028571d92e76ee49ba3eb88ba94/stories/extensions/test/index.tsx#L170 对于monaco-editor内置支持的语言,基本的语法高亮是都支持的,对于代码补全,貌似仅支持 typescript, javascript, css, less, scss, json, html这些语言。monaco-editor支持的语言可以查看:https://github.com/microsoft/monaco-editor/tree/v0.32.0/src/basic-languages 要自定义支持其它语言的高亮或者代码补全,需要自己实现,可以参考网络上monaco-editor相关的一些文章。可能需要用到monaco-editor提供的一些api,可以从'@dtinsight/molecule/esm/monaco'路径导出,例如: `import { languages } from '@dtinsight/molecule/esm/monaco';`
在 2.x 版本进行升级,升级完成后将 monaco-sql-languages 的 website 升级到 molecule 2.x