wiihame / monaco-python-lsp Goto Github PK
View Code? Open in Web Editor NEWSupport python lsp in monaco
Support python lsp in monaco
rt
目前有个需求,用monaco做一个python自动补全的编辑器,目前能找到类似的,貌似只有这个库,但是本地跑不起来,
pip install pyls_jsonrpc 报错,然后我去搜这个包,不存在
所以来问下,这个问题有办法解决么?
万分感谢🙏
mERROR:tornado.application:Uncaught exception GET /python (::1)
HTTPServerRequest(protocol='http', host='localhost:3004', method='GET', uri='/python', version='HTTP/1.1', remote_ip='::1')
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/tornado/websocket.py", line 954, in _accept_connection
open_result = handler.open(*handler.open_args, **handler.open_kwargs)
File "/Users/tielan/workspace/Monaco-python-lsp/python-server/langserver_ext.py", line 22, in open
proc = process.Subprocess(
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/tornado/process.py", line 240, in __init__
self.proc = subprocess.Popen(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 966, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 1842, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'pyls'
ERROR:tornado.application:Uncaught exception GET /python (::1)
HTTPServerRequest(protocol='http', host='localhost:3004', method='GET', uri='/python', version='HTTP/1.1', remote_ip='::1')
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/tornado/websocket.py", line 954, in _accept_connection
open_result = handler.open(*handler.open_args, **handler.open_kwargs)
File "/Users/tielan/workspace/Monaco-python-lsp/python-server/langserver_ext.py", line 22, in open
proc = process.Subprocess(
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/tornado/process.py", line 240, in __init__
self.proc = subprocess.Popen(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 966, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 1842, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'pyls'
^CTraceback (most recent call last):
File "/Users/tielan/workspace/Monaco-python-lsp/python-server/langserver_ext.py", line 56, in <module>
ioloop.IOLoop.current().start()
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/tornado/platform/asyncio.py", line 199, in start
self.asyncio_loop.run_forever()
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/base_events.py", line 595, in run_forever
self._run_once()
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/base_events.py", line 1845, in _run_once
event_list = self._selector.select(timeout)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/selectors.py", line 562, in select
kev_list = self._selector.control(None, max_ev, timeout)
KeyboardInterrupt
非常感觉您的项目, 正是我需要的. 然后我还有另外一项功能, 不知道该怎么实现了. 您有空帮忙看看.
我想实现内置一些class, function, variable到编辑器中, 这些都需要是动态注入的,可能经常变化. 而且没有实现,只有声明.
我能想到的是使用 .pyi 文件来做这件事. 但是不知道该怎么把我自定义的文件注入到pyls/lsp/jedi中
ex: ide.pyi
class Person:
def study(self) -> None: ...
def play(self) -> None: ...
当我写如下代码时, 第一行的Person, 第二行的study 都能够自动提示出来
p = Person()
p.study()
Uncaught exception GET /python (xx.xx.xxx.x)
HTTPServerRequest(protocol='http', host='xx.xx.xxx.x:3001', method='GET', uri='/python', version='HTTP/1.1', remote_ip='xx.xx.xxx.x')
Traceback (most recent call last):
File "/usr/local/python3/lib/python3.9/site-packages/tornado/websocket.py", line 942, in _accept_connection
open_result = handler.open(*handler.open_args, **handler.open_kwargs)
File "/root/code/Monaco-python-lsp/python-server/langserver_ext.py", line 22, in open
proc = process.Subprocess(
File "/usr/local/python3/lib/python3.9/site-packages/tornado/process.py", line 240, in init
self.proc = subprocess.Popen(*args, **kwargs)
File "/usr/local/python3/lib/python3.9/subprocess.py", line 951, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "/usr/local/python3/lib/python3.9/subprocess.py", line 1821, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'pyls'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.