Open maths-lover opened 2 weeks ago
Ah, and I forgot to mention that with jedi it worked fine without any issue.
@DanCip00 I don't see much difference, it still gets stuck for me when I try to make some request to the lsp server.
I did notice the following,
if self.language_id != "python":
await self.completions_available.wait()
But while I was debugging it never got stuck there, it gets stuck when I make a "request/defintion"
and such.
For one use case (it happens in possibly all other) I've pinpointed to the following position,
with self.open_file(relative_file_path):
# sending request to the language server and waiting for response
response = await self.server.send.definition(
{
LSPConstants.TEXT_DOCUMENT: {
LSPConstants.URI: pathlib.Path(
str(PurePath(self.repository_root_path, relative_file_path))
).as_uri()
},
LSPConstants.POSITION: {
LSPConstants.LINE: line,
LSPConstants.CHARACTER: column,
},
}
)
print("Stuck here?")
that print("Stuck here")
which I added, was never called in
async def request_definition(
self, relative_file_path: str, line: int, column: int
) -> List[multilspy_types.Location]:
method in language_server.py
For some reason, the asyncio.Condition()
doesn't get released.
I do a simple copy of jedi-language-server, replace jedi calls to pyright, everything seems to work except the request goes to stdin (not sure if they actually do) but no response comes back.
A demo can be seen in the following asciicast
Please provide me insight if I'm doing something wrong here.
Thank you!