3.10.2 • Published 2 years ago

@krassowski/jupyterlab-lsp v3.10.2

Weekly downloads
4,419
License
BSD-3-Clause
Repository
github
Last release
2 years ago

Language Server Protocol integration for JupyterLab

This extension is highly experimental, though you are encouraged to try it, leave feedback and/or a PR

Features overview:

Implemented:

  • hover over any piece of code; if an underline appears, you can press Ctrl to get a tooltip with function/class signature, module documentation or any other piece of information that the language server provides

hover

  • linting: critical errors have red underline, warnings are orange, etc. Hover over the underlined code to see the linter's message

inspections

  • go to definition: use context menu entries to jump to definition (currently only in the file editor)
  • highlight usages: just place your cursor on a variable, function etc and all the usages will be highlighted (works only in the file editor or within a single cell)
  • advanced autocompletion - even when the kernel is off!

autocompletion

In progress:

  • auto invocation of completer on certain characters (e.g. '.' (dot) in Python)
  • completer: merge suggestions from LSP, kernel and tokens (currently LSP and tokens only)
  • better go-to-definition functionality, including notebook

Planned:

  • "rename" action

May be included:

  • Gutter with linter results

Under the hood

This would not be possible if not the fantastic work of https://github.com/wylieconlon/lsp-editor-adapter.

Prerequisites

  • JupyterLab

Installation

  1. install the extension:
jupyter labextension install @krassowski/jupyterlab-lsp
  1. install servers for languages of your choice. Below are examples for Python (with pyls) and R (with languageserver):
pip install python-language-server[all]
R -e 'install.packages("languageserver")'

For the full list of language servers see the Microsoft's list; it may also be good to visit the repository of each server as many provide some additional configuration options.

  1. create servers.yml file:
langservers:
  python:
    - pyls
  R:
    - R
    - --slave
    - -e
    - languageserver::run()
  1. Each time before starting JupyterLab, run:
node node_modules/jsonrpc-ws-proxy/dist/server.js --port 3000 --languageServers servers.yml
  1. (Optional) to enable opening files outside of the root directory (the place where you start JupyterLab), create .lsp_symlink and symlink your home, usr, or any other location which include the files that you wish to make possible to open in there:
mkdir .lsp_symlink
cd .lsp_symlink
ln -s /home home
ln -s /usr usr

If your user does not have sufficient permissions to traverse the entire path, you will not be able to open the file.

Updatng the extension

To update already installed extension:

jupyter labextension update @krassowski/jupyterlab_lsp

Development

For a development install (requires npm version 4 or later), do the following in the repository directory:

npm install
npm run build
jupyter labextension link .

To rebuild the package and the JupyterLab app:

npm run build
jupyter lab build

To run tests suite:

npm test
3.10.2

2 years ago

3.10.1

2 years ago

3.10.0

2 years ago

3.9.3

2 years ago

3.9.2

2 years ago

3.9.1

2 years ago

3.9.0

2 years ago

3.8.1

3 years ago

3.8.0

3 years ago

3.7.0

3 years ago

3.6.0

3 years ago

3.5.0

3 years ago

2.1.4

3 years ago

3.4.1

3 years ago

3.4.0

3 years ago

3.2.0

3 years ago

3.3.1

3 years ago

3.3.0

3 years ago

3.1.0

3 years ago

2.1.3

3 years ago

3.0.0

3 years ago

2.1.2

3 years ago

2.1.1

3 years ago

2.1.0

3 years ago

2.0.8

3 years ago

2.0.7

4 years ago

2.0.6

4 years ago

2.0.5

4 years ago

2.0.4

4 years ago

2.0.3

4 years ago

2.0.2

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.1.1

4 years ago

1.1.2

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago

0.8.0

4 years ago

0.7.1

4 years ago

0.7.0

4 years ago

0.7.0-rc.1

4 years ago

0.7.0-rc.0

4 years ago

0.7.0-beta.1

4 years ago

0.7.0-beta.0

4 years ago

0.6.1

4 years ago

0.6.0

4 years ago

0.5.0

5 years ago

0.5.0-rc.2

5 years ago

0.5.0-rc.1

5 years ago

0.5.0-rc.0

5 years ago

0.5.0-beta.5

5 years ago

0.5.0-beta.4

5 years ago

0.5.0-beta.3

5 years ago

0.5.0-beta.2

5 years ago

0.5.0-beta.1

5 years ago

0.5.0-beta.0

5 years ago

0.5.0-alpha.2

5 years ago

0.5.0-alpha.1

5 years ago

0.5.0-alpha.0

5 years ago

0.4.1

5 years ago

0.4.0

5 years ago

0.3.0

5 years ago

0.2.0-beta.0

5 years ago

0.1.0-beta.2

5 years ago

0.1.0-beta.1

5 years ago

0.1.0-beta.0

5 years ago

0.1.0-alpha.1

5 years ago

0.1.0-alpha.0

5 years ago