Skip to content

Commit 72ea6b1

Browse files
authored
Update installation instructions
1 parent 34a7c74 commit 72ea6b1

File tree

1 file changed

+27
-42
lines changed

1 file changed

+27
-42
lines changed

README.md

Lines changed: 27 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -84,65 +84,50 @@ This would not be possible if not the fantastic work at [wylieconlon/lsp-editor-
8484

8585
## Installation
8686

87-
1. install the extension:
87+
For 0.6 version:
8888

89-
```bash
90-
jupyter labextension install @krassowski/jupyterlab-lsp
91-
```
92-
93-
2. install servers for languages of your choice. Below are examples for Python (with [pyls](https://github.com/palantir/python-language-server)) and R (with [languageserver](https://github.com/REditorSupport/languageserver)):
94-
95-
```bash
96-
pip install python-language-server[all]
97-
```
98-
99-
```bash
100-
R -e 'install.packages("languageserver")'
101-
```
89+
1. install and enable the server extension:
10290

103-
For the full list of language servers see the [Microsoft's list](https://microsoft.github.io/language-server-protocol/implementors/servers/); it may also be good to visit the repository of each server as many provide some additional configuration options.
91+
```bash
92+
pip install jupyter-lsp
93+
jupyter serverextension enable --sys-prefix --py jupyter_lsp
94+
```
10495

105-
3. create `servers.yml` file:
96+
2. install the frontend extension:
10697

107-
```yaml
108-
langservers:
109-
python:
110-
- pyls
111-
R:
112-
- R
113-
- --slave
114-
- -e
115-
- languageserver::run()
116-
```
98+
```bash
99+
jupyter labextension install @krassowski/jupyterlab-lsp
100+
```
117101

118-
4. Each time before starting JupyterLab, run:
102+
3. install LSP servers for languages of your choice; for example, for Python ([pyls](https://github.com/palantir/python-language-server)) and R ([languageserver](https://github.com/REditorSupport/languageserver)) servers, use:
119103

120-
```bash
121-
node path_to_jupyterlab_staging/node_modules/jsonrpc-ws-proxy/dist/server.js --port 3000 --languageServers servers.yml
122-
```
104+
```bash
105+
pip install python-language-server[all]
106+
R -e 'install.packages("languageserver")'
107+
```
123108

124-
where `path_to_jupyterlab_staging` is the location of JupyterLab staging directory. Here are example locations on Ubuntu:
109+
Please see our full list of [supported language servers](./py_src/jupyter_lsp/README.md#installing-language-servers) which includes installation hints for the common package managers (npm/pip/conda).
110+
In general, any LSP server from the [Microsoft's list](https://microsoft.github.io/language-server-protocol/implementors/servers/) should work after [some additional configuration](./py_src/jupyter_lsp/CONTRIBUTING.md#specs).
125111

126-
- if you use pyenv it should be in `~/.pyenv/versions/YOUR_VERSION_OR_VENV/share/jupyter/lab/staging/`
127-
- if you use local installation, it might be in `~/.local/lib/python3.6/site-packages/jupyterlab/staging/` (where instead of python3.6 you should use your Python3 version having JupyterLab installed)
112+
Note: it may be worth visiting the repository of each server you install as many provide additional configuration options.
128113

129-
5. (Optional) to enable opening files outside of the root directory (the place where you start JupyterLab),
130-
create `.lsp_symlink` and symlink your `home`, `usr`, or any other location which includes the files that you wish to make possible to open in there:
114+
4. (Optional) to enable opening files outside of the root directory (the place where you start JupyterLab),
115+
create `.lsp_symlink` and symlink your `home`, or any other location which includes the files that you wish to make possible to open in there:
131116

132-
```bash
133-
mkdir .lsp_symlink
134-
cd .lsp_symlink
135-
ln -s /home home
136-
ln -s /usr usr
137-
```
117+
```bash
118+
mkdir .lsp_symlink
119+
cd .lsp_symlink
120+
ln -s /home home
121+
```
138122

139-
If your user does not have sufficient permissions to traverse the entire path, you will not be able to open the file. A more detailed guide on symlinking (written for a related jupyterlab-go-to-definition extension) is available [here](https://github.com/krassowski/jupyterlab-go-to-definition/blob/master/README.md#which-directories-to-symlink).
123+
If your user does not have sufficient permissions to traverse the entire path, you will not be able to open the file. A more detailed guide on symlinking (written for a related jupyterlab-go-to-definition extension) is available [here](https://github.com/krassowski/jupyterlab-go-to-definition/blob/master/README.md#which-directories-to-symlink).
140124

141125
### Updating the extension
142126

143127
To update already installed extension:
144128

145129
```bash
130+
pip install -U jupyter-lsp
146131
jupyter labextension update @krassowski/jupyterlab-lsp
147132
```
148133

0 commit comments

Comments
 (0)