Skip to content

Commit 6cf0ffe

Browse files
committed
Merge from 4.x: PR spyder-ide#12792
Fixes spyder-ide#12572 Fixes spyder-ide#12333
2 parents 2135228 + 06edb40 commit 6cf0ffe

49 files changed

Lines changed: 659 additions & 304 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.pep8speaks.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# File : .pep8speaks.yml
2-
31
scanner:
42
diff_only: True # Errors caused by only the patch are shown
3+
linter: pycodestyle
4+
5+
pycodestyle:
6+
exclude: external-deps

binder/environment.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ dependencies:
1515
- diff-match-patch >=20181111
1616
- intervaltree
1717
- ipython >=4.0
18-
- jedi =0.15.2
18+
- jedi =0.17.0
1919
- keyring
2020
- nbconvert >=4.0
2121
- numpydoc >=0.6.0
2222
- paramiko >=2.4.0
23-
- parso =0.5.2
23+
- parso =0.7.0
2424
- pexpect >=4.4.0
2525
- pickleshare >=0.4
2626
- psutil >=5.3

external-deps/python-language-server/.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414

1515
python3-test:
1616
docker:
17-
- image: "python:3.5-stretch"
17+
- image: "python:3.6-stretch"
1818
steps:
1919
- checkout
2020
# To test Jedi environments
@@ -35,7 +35,7 @@ jobs:
3535

3636
publish:
3737
docker:
38-
- image: "python:3.5-stretch"
38+
- image: "python:3.6-stretch"
3939
steps:
4040
- checkout
4141
- run: ./scripts/circle/pypi.sh

external-deps/python-language-server/.gitrepo

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
[subrepo]
77
remote = https://github.com/palantir/python-language-server.git
88
branch = develop
9-
commit = fdb8b3dbc5df7d12729d135932bf2264e0883061
10-
parent = 0798ff6e51f6d1c353b8278469a32adab54b874f
9+
commit = 9b5cb2197405b2290161deb2abd8e2b139a53691
10+
parent = dbb0398cd7e309e6de7a7740c57a03ecbb26ac11
1111
method = merge
1212
cmdver = 0.4.1

external-deps/python-language-server/README.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ To enable pydocstyle for linting docstrings add the following setting in your LS
7272
"pyls.plugins.pydocstyle.enabled": true
7373
```
7474

75+
See `vscode-client/package.json`_ for the full set of supported configuration options.
76+
77+
.. _vscode-client/package.json: vscode-client/package.json
78+
7579
Language Server Features
7680
------------------------
7781

external-deps/python-language-server/appveyor.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ environment:
66
PYTHON_VERSION: "2.7.15"
77
PYTHON_ARCH: "64"
88

9-
- PYTHON: "C:\\Python35"
10-
PYTHON_VERSION: "3.5.7"
9+
- PYTHON: "C:\\Python36"
10+
PYTHON_VERSION: "3.6.8"
1111
PYTHON_ARCH: "64"
1212

1313
matrix:

external-deps/python-language-server/pyls/_utils.py

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# Copyright 2017 Palantir Technologies, Inc.
2-
from distutils.version import LooseVersion
32
import functools
43
import inspect
54
import logging
@@ -140,18 +139,34 @@ def format_docstring(contents):
140139
"""
141140
contents = contents.replace('\t', u'\u00A0' * 4)
142141
contents = contents.replace(' ', u'\u00A0' * 2)
143-
if LooseVersion(JEDI_VERSION) < LooseVersion('0.15.0'):
144-
contents = contents.replace('*', '\\*')
145142
return contents
146143

147144

148145
def clip_column(column, lines, line_number):
149-
# Normalise the position as per the LSP that accepts character positions > line length
150-
# https://github.com/Microsoft/language-server-protocol/blob/master/protocol.md#position
146+
"""
147+
Normalise the position as per the LSP that accepts character positions > line length
148+
149+
https://microsoft.github.io/language-server-protocol/specification#position
150+
"""
151151
max_column = len(lines[line_number].rstrip('\r\n')) if len(lines) > line_number else 0
152152
return min(column, max_column)
153153

154154

155+
def position_to_jedi_linecolumn(document, position):
156+
"""
157+
Convert the LSP format 'line', 'character' to Jedi's 'line', 'column'
158+
159+
https://microsoft.github.io/language-server-protocol/specification#position
160+
"""
161+
code_position = {}
162+
if position:
163+
code_position = {'line': position['line'] + 1,
164+
'column': clip_column(position['character'],
165+
document.lines,
166+
position['line'])}
167+
return code_position
168+
169+
155170
if os.name == 'nt':
156171
import ctypes
157172

external-deps/python-language-server/pyls/config/pycodestyle_conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
('ignore', 'plugins.pycodestyle.ignore', list),
1616
('max-line-length', 'plugins.pycodestyle.maxLineLength', int),
1717
('select', 'plugins.pycodestyle.select', list),
18+
('aggressive', 'plugins.pycodestyle.aggressive', int),
1819
]
1920

2021

external-deps/python-language-server/pyls/lsp.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ class CompletionItemKind(object):
2424
Color = 16
2525
File = 17
2626
Reference = 18
27+
Folder = 19
28+
EnumMember = 20
29+
Constant = 21
30+
Struct = 22
31+
Event = 23
32+
Operator = 24
33+
TypeParameter = 25
2734

2835

2936
class DocumentHighlightKind(object):

external-deps/python-language-server/pyls/plugins/autopep8_format.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ def _autopep8_config(config):
5757
'ignore': settings.get('ignore'),
5858
'max_line_length': settings.get('maxLineLength'),
5959
'select': settings.get('select'),
60+
'aggressive': settings.get('aggressive'),
6061
}
6162

6263
# Filter out null options

0 commit comments

Comments
 (0)