Skip to content

Catch errors when getting docstrings on _resolve_completion #64

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

Merged
Merged
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
7 changes: 6 additions & 1 deletion pylsp/plugins/jedi_completion.py
Original file line number Diff line number Diff line change
@@ -165,8 +165,13 @@ def use_snippets(document, position):


def _resolve_completion(completion, d):
# pylint: disable=broad-except
completion['detail'] = _detail(d)
completion['documentation'] = _utils.format_docstring(d.docstring())
try:
docs = _utils.format_docstring(d.docstring())
except Exception:
docs = ''
completion['documentation'] = docs
return completion


1 change: 1 addition & 0 deletions test/test_language_server.py
Original file line number Diff line number Diff line change
@@ -86,6 +86,7 @@ def test_initialize(client_server): # pylint: disable=redefined-outer-name
assert 'capabilities' in response


@flaky(max_runs=10, min_passes=1)
@pytest.mark.skipif(os.name == 'nt' or (sys.platform.startswith('linux') and PY3),
reason='Skipped on win and fails on linux >=3.6')
def test_exit_with_parent_process_died(client_exited_server): # pylint: disable=redefined-outer-name