Skip to content

Commit

Permalink
Remove type annotation because it will break Python 2 build.
Browse files Browse the repository at this point in the history
  • Loading branch information
CXuesong committed Apr 7, 2019
1 parent e363239 commit a76f2e6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
9 changes: 4 additions & 5 deletions pyls/plugins/symbols.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Copyright 2017 Palantir Technologies, Inc.
import logging
from jedi.api.classes import Definition
from pyls import hookimpl
from pyls.lsp import SymbolKind

Expand All @@ -11,11 +10,11 @@
def pyls_document_symbols(config, document):
# all_scopes = config.plugin_settings('jedi_symbols').get('all_scopes', True)
definitions = document.jedi_names(all_scopes=False)
def transform(d: Definition):
includeD = _include_def(d)
if includeD is None:
def transform(d):
include_d = _include_def(d)
if include_d is None:
return None
children = [dt for dt in (transform(d1) for d1 in d.defined_names()) if dt] if includeD else None
children = [dt for dt in (transform(d1) for d1 in d.defined_names()) if dt] if include_d else None
detailName = d.full_name
if detailName and detailName.startswith("__main__."):
detailName = detailName[9:]
Expand Down
4 changes: 1 addition & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,4 @@ exclude = test/plugins/.ropeproject,test/.ropeproject

[tool:pytest]
testpaths = test
addopts =
--cov-report html --cov-report term --junitxml=pytest.xml
--cov pyls --cov test

0 comments on commit a76f2e6

Please sign in to comment.