Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

WeDataSphere/Monaco-python-lsp

Open more actions menu
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Monaco Editor LSP

该项目是基于 monaco-editor 以及 python-languageserver 开发的带有 intellisense、auto-complete 等 LSP 能力(language server protocol)的编辑器。

项目分为 client 和 server 两端:

  • client:基于 express 运行的 nodejs 服务,提供编辑器页面
  • server:基于 tornado 的 python web server,通过 pyls-jsonrpc 提供 LSP 服务

client 和 server 之间的连接方式是 websocket,通过 typefox 的 monaco-languageclient 包向 server 发送补全求情,在收到补全信息后,monaco-languageclient 会在 monaco 内展示补全内容。


本地调试开发教程:

  1. 安装 python 依赖(python 3.4+)
pip install tornado python-jsonrpc-server

| 安装依赖的时候使用python-jsonrpc-server,调用的时候用pyls_jsonrpc的包名 (出处

  1. 运行脚本
python python-server/langserver_ext.py
  1. 访问http://localhost:3001/python(默认启动端口,可自己修改),若有"Can "Upgrade" only to "WebSocket"."的文字提示,即服务其成功启动

  2. 启动 expres

安装依赖

yarn

编译 ts 代码

yarn prepare

启动 express

yarn start:ext
  1. 访问http://localhost:3002/(默认启动端口,可自己修改),能看到带语法高亮、输入 python 代码有自动补全,即运行成功

About

Support python lsp in monaco

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 49.7%
  • Python 33.3%
  • JavaScript 14.5%
  • HTML 2.5%
Morty Proxy This is a proxified and sanitized view of the page, visit original site.