github / github/copilot-language-server-release

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

Đang mở
#20 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Không có dữ liệu ngôn ngữ
Star
290
Fork
24
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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']
```

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Start with jupyter_copilot/lsp.py and the shown send_request entry point; manually run node ./node_modules/@github/copilot-language-server/dist/language-server.js --stdio and inspect whether initialize receives a response. Trace the request and response handling around resolve_map and reject_map. Done means identifying why initialize is unanswered and documenting or implementing a verified fix.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
node.js, python
Lĩnh vực
devtools
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
30/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.