github / github/copilot-language-server-release

TimeoutError: Request timed out: method=initialize, id=1

未关闭
#20 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
没有语言数据
星标
290
派生
24
PR 合并指标
30 天内没有已合并 PR

描述

Trying to troubleshoot the error of a python wrapper from jupyter-copilot [https://github.com/baolong281/jupyter-copilot/blob/main/jupyter_copilot/lsp.py](url). The error is coming from the function below in the wrapper.

Is there anyway I could elicit why there is no response from the server say if the server could be started manually?

node ./node_modules/@github/copilot-language-server/dist/language-server.js --stdio

```
def send_request(self, method: str, params: dict) -> Any:
"""
sends a request to the lsp and returns the response
if a response comes then __handle_recieved_payloads will be called
and will run the resolve or reject callback
"""
self.request_id += 1
self.__send_message({"id": self.request_id, "method": method, "params": params})
result = threading.Event()
response = {}

def resolve(payload):
response['result'] = payload
result.set()

def reject(payload):
response['error'] = payload
result.set()

# put the callback into the map
# when we get the response, we will call resolve or reject and the entry will be popped
self.resolve_map[self.request_id] = resolve
self.reject_map[self.request_id] = reject

# 10 second timeout to prevent indefinite waiting
# this will immediately stop blocking if the result is set by calling either resolve or reject
result.wait(timeout=10)

# at this point if a response has not been received then result will not be set, so we throw an error
if not result.is_set():
raise TimeoutError(f"Request timed out: method={method}, id={self.request_id}")

if 'error' in response:
raise Exception(response['error'])

self.resolve_map.pop(self.request_id, None)
self.reject_map.pop(self.request_id, None)
return response['result']
```

贡献指南

打开贡献指南

调研方向

从 jupyter_copilot/lsp.py 和所示的 send_request 入口开始;手动运行 node ./node_modules/@github/copilot-language-server/dist/language-server.js --stdio,并检查 initialize 是否收到响应。跟踪 resolve_map 和 reject_map 周围的请求与响应处理。完成的标准是确定 initialize 未收到响应的原因,并记录或实现一个经过验证的修复。

由索引模型根据 Issue 内容生成。

评估

技术栈
node.js, python
领域
devtools
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
需要澄清
新手友好度
30/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。