Skip to content

Commit

Permalink
Merge pull request #584 from krassowski/switch-to-pyls-fork
Browse files Browse the repository at this point in the history
Switch to python-lsp-server for testing
  • Loading branch information
krassowski authored Apr 25, 2021
2 parents eaf53f7 + 4994f63 commit cf1ce3b
Show file tree
Hide file tree
Showing 12 changed files with 18 additions and 20 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,19 +119,19 @@ Use of a python `virtualenv` or a conda env is also recommended.
> or `jupyter-lsp-r` to install both the server extension and the language server.
1. install LSP servers for languages of your choice; for example, for Python
([pyls](https://github.com/palantir/python-language-server)) and
([pylsp](https://github.com/python-lsp/python-lsp-server)) and
R ([languageserver](https://github.com/REditorSupport/languageserver)) servers:

```bash
# note: you may want to use our fork of python-language-server instead (see below)
pip install 'python-language-server[all]'
pip install 'python-lsp-server[all]'
R -e 'install.packages("languageserver")'
```

or from `conda-forge`

```bash
conda install -c conda-forge python-language-server r-languageserver
conda install -c conda-forge python-lsp-server r-languageserver
```

Please see our full list of
Expand Down Expand Up @@ -188,6 +188,8 @@ Use of a python `virtualenv` or a conda env is also recommended.

Server configurations can be edited using the Advanced Settings editor in JupyterLab (_Settings > Advanced Settings Editor_). For settings specific to each server, please see the [table of language servers][language-servers]. Example settings might include:

> Note: for the new (currently recommended) python-lsp-server replace `pyls` occurrences with `pyslp`
```json
{
"language_servers": {
Expand Down
2 changes: 1 addition & 1 deletion atest/05_Features/Completion.robot
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ Completion Works For Tokens Separated By Space
Wait Until Keyword Succeeds 40x 0.5s Cell Editor Should Equal 13 from statistics import

Kernel And LSP Completions Merge Prefix Conflicts Are Resolved
[Documentation] Reconciliate Python kernel returning prefixed completions and LSP (pyls) not-prefixed ones
[Documentation] Reconciliate Python kernel returning prefixed completions and LSP (pylsp) not-prefixed ones
Configure JupyterLab Plugin {"kernelResponseTimeout": -1, "waitForBusyKernel": false} plugin id=${COMPLETION PLUGIN ID}
# For more details see: https://github.com/krassowski/jupyterlab-lsp/issues/30#issuecomment-576003987
# `import os.pat<tab>` → `import os.pathsep`
Expand Down
4 changes: 2 additions & 2 deletions atest/07_Configuration.robot
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ Resource ./Keywords.robot
*** Test Cases ***
Python
[Documentation] pyflakes is enabled by default, but flake8 is not
Settings Should Change Editor Diagnostics Python style.py pyls
... {"pyls": {"plugins": {"flake8": {"enabled": true},"pyflakes": {"enabled": false}}}}
Settings Should Change Editor Diagnostics Python style.py pylsp
... {"pylsp": {"plugins": {"flake8": {"enabled": true},"pyflakes": {"enabled": false}}}}
... undefined name 'foo' (pyflakes)
... undefined name 'foo' (flake8)

Expand Down
4 changes: 2 additions & 2 deletions atest/Variables.robot
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,5 @@ ${JLAB XP CLOSE SETTINGS} ${JLAB XP DOCK TAB}\[contains(., 'Settings')]/*[con
${CSS DIAGNOSTIC} css:.cm-lsp-diagnostic
# log messages
@{KNOWN BAD ERRORS}
... pyls_jsonrpc.endpoint - Failed to handle notification
... pyls_jsonrpc.endpoint - Failed to handle request
... pylsp_jsonrpc.endpoint - Failed to handle notification
... pylsp_jsonrpc.endpoint - Failed to handle request
2 changes: 1 addition & 1 deletion binder/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ dependencies:
- pyls-black
- pyls-isort
- pyls-mypy
- python-language-server
- python-lsp-server
- ruamel_yaml
# for R language server and kernel
- r
Expand Down
2 changes: 1 addition & 1 deletion docs/rtd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ dependencies:
- pandas
- pytest-check-links
- myst-nb
- python-language-server
- python-lsp-server
- sphinx
- sphinx-autodoc-typehints
- sphinx-copybutton
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@


class PythonLSPServer(PythonModuleSpec):
python_module = key = "python-lsp-server"
python_module = key = "pylsp"
languages = ["python"]
spec = dict(
display_name="python-lsp-server",
display_name="python-lsp-server (pylsp)",
mime_types=["text/python", "text/x-ipython"],
urls=dict(
home="https://github.com/python-lsp/python-lsp-server",
Expand Down
2 changes: 1 addition & 1 deletion python_packages/jupyter_lsp/jupyter_lsp/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"bash-language-server",
"dockerfile-language-server-nodejs",
"javascript-typescript-langserver",
"pyls",
"pylsp",
"unified-language-server",
"sql-language-server",
"vscode-css-languageserver-bin",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ async def test_start_unknown(known_unknown_server, handlers, jsonrpc_init_msg):
@pytest.mark.asyncio
async def test_ping(handlers):
"""see https://github.com/krassowski/jupyterlab-lsp/issues/458"""
a_server = "pyls"
a_server = "pylsp"

handler, ws_handler = handlers
manager = handler.manager
Expand Down
6 changes: 1 addition & 5 deletions requirements/github-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,4 @@ dependencies:
- geckodriver
- robotframework >=4
- robotframework-seleniumlibrary
# TODO: remove when jedi vs IPython vs python-language-server is resolved
- jedi <0.18
- ipython <7.20 # higher basically broken _without_ jedi 0.18
- python-language-server ==0.36.2
- autopep8 <1.5.6 # higher requires pycodestyle incompatible with python-language-server
- python-lsp-server
2 changes: 1 addition & 1 deletion requirements/utest.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ pytest-asyncio
pytest-cov
pytest-flake8
pytest-runner
python-language-server
python-lsp-server
pluggy<1.0,>=0.12 # Python 3.5 CI Travis, may need update with new pytest releases, see issue 259

0 comments on commit cf1ce3b

Please sign in to comment.