Skip to content

Commit 2a524df

Browse files
authored
Merge pull request #846 from slavistan/master
Fix instructions for .lsp_symlink workaround
2 parents fac38e1 + f5c7a65 commit 2a524df

File tree

2 files changed

+20
-12
lines changed

2 files changed

+20
-12
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
- remove references to pylsp fork ([#800] and [#814], thanks @joelostblom and @nickfong)
1717
- add Robot Framework language server ([#724], thanks @bollwyvl)
1818
- add a list of third-party and community language servers ([#826], thanks @cccs-jc)
19+
- fix documentation of .lsp_symlink workaround ([#828])
1920
- maintenance:
2021
- bump minimum required JupyterLab version to 3.3 (`>=3.3.0,<4.0.0a0`)
2122
- bump minimum required Node.js version to 14.0 (12.0 reached EOL in April)

README.md

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -164,21 +164,28 @@ Use of a python `virtualenv` or a conda env is also recommended.
164164
or permanently by setting `c.Completer.use_jedi = False` in your
165165
[`ipython_config.py` file](https://ipython.readthedocs.io/en/stable/config/intro.html?highlight=ipython_config.py#systemwide-configuration).
166166

167-
1. (Optional, Linux/OSX-only) to enable opening files outside of the root
168-
directory (the place where you start JupyterLab), create `.lsp_symlink` and
169-
symlink your `/home`, or any other location which includes the files that you
170-
wish to make possible to open in there:
167+
1. (Optional, Linux/OSX-only) As a security measure by default Jupyter server only allows
168+
access to files under the Jupyter root directory (the place where you launch the Jupyter server).
169+
Thus, in order to allow `jupyterlab-lsp` to navigate to external files such as packages
170+
installed system-wide or to libraries inside a virtual environment (`conda`,
171+
`pip`, ...) this access control mechanism needs to be circumvented: inside your Jupyter
172+
root directory create a symlink named _.lsp_symlink_ pointing to your system root `/`.
171173

172-
```bash
173-
mkdir .lsp_symlink
174-
cd .lsp_symlink
175-
ln -s /home home
176174
```
175+
ln -s / .lsp_symlink
176+
```
177+
178+
As this symlink is a hidden file the Jupyter server must be instructed to
179+
serve hidden files. Either use the appropriate command line flag:
180+
181+
```
182+
jupyter lab --ContentsManager.allow_hidden=True
183+
```
184+
185+
or, alternatively, set the corresponding setting inside your `jupyter_server_config.py`.
177186

178-
If your user does not have sufficient permissions to traverse the entire path,
179-
you will not be able to open the file. A more detailed guide on symlinking
180-
(written for a related jupyterlab-go-to-definition extension) is available
181-
[here](https://github.com/krassowski/jupyterlab-go-to-definition/blob/master/README.md#which-directories-to-symlink).
187+
Help in implementing a custom [`ContentsManager`](https://github.com/jupyter-lsp/jupyterlab-lsp/issues/850)
188+
which will enable navigating to external files without the symlink is welcome.
182189

183190
### Configuring the servers
184191

0 commit comments

Comments
 (0)