Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix async implementation not supported #204

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions pylsp/python_lsp.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import os
import socketserver
import threading

import asyncio
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move this to be on top of from functools import partial and leave the blank line here.

from pylsp_jsonrpc.dispatchers import MethodDispatcher
from pylsp_jsonrpc.endpoint import Endpoint
from pylsp_jsonrpc.streams import JsonRpcStreamReader, JsonRpcStreamWriter
Expand Down Expand Up @@ -464,7 +464,15 @@ def m_workspace__execute_command(self, command=None, arguments=None):


def flatten(list_of_lists):
return [item for lst in list_of_lists for item in lst]
new_list_of_lists = []
for lst in list_of_lists:
if asyncio.iscoroutine(lst):
res = asyncio.run(lst)
new_list_of_lists.append(res)
else:
new_list_of_lists.append(lst)

return [item for lst in new_list_of_lists for item in lst]


def merge(list_of_dicts):
Expand Down