monaco-editor-python
monaco-editor-python copied to clipboard
monaco-editor编辑器添加Python代码提示
monaco-editor-python
monaco-editor 编辑器使用 jsonrpc-ws-proxy 和 python-language-server,实现 python 代码提示功能
效果

运行步骤
运行环境
- node.js 和 python 环境
准备工作
-
node.js 安装 npm 和 yarn
-
python 安装
python-language-serverpip install 'python-language-server[all]'
启动前端项目
-
进入 web 目录,依次运行以下命令启动前端项目
yarn yarn prepare yarn run start
启动语言代理
-
方式一:Python 代理(推荐)
进入
server2目录,运行以下命令启动代理程序python examples/langserver_ext.pyGithub 仓库:https://github.com/shanghaobo/python-jsonrpc-server
-
方式二:node.js 代理
进入
server目录,依次运行以下命令启动代理程序npm install npm run prepare node dist/server.js --port 5000 --languageServers servers.yml
- 访问
http://localhost:3000