Why code completion still works when uninstall jupyter-lsp

When I created a new virtual env, I installed jupyterlab with pip3 install jupyterlab; then I uninstall jupyter-lsp with command pip3 uninstall jupyter-lsp

What surprised me is The Code Completion still works.

According to the doc, I thought jupyter-lsp (for server side), jupyterlab-lsp (for browser side) and language server ALL needed for Code Completion

Why?

BTW: the result of pip3 freeze

anyio==4.3.0
argon2-cffi==23.1.0
argon2-cffi-bindings==21.2.0
arrow==1.3.0
asttokens==2.4.1
async-lru==2.0.4
attrs==23.2.0
Babel==2.14.0
beautifulsoup4==4.12.3
bleach==6.1.0
certifi==2024.2.2
cffi==1.16.0
charset-normalizer==3.3.2
comm==0.2.1
debugpy==1.8.1
decorator==5.1.1
defusedxml==0.7.1
exceptiongroup==1.2.0
executing==2.0.1
fastjsonschema==2.19.1
fqdn==1.5.1
h11==0.14.0
httpcore==1.0.4
httpx==0.27.0
idna==3.6
ipykernel==6.29.3
ipython==8.22.1
isoduration==20.11.0
jedi==0.19.1
Jinja2==3.1.3
json5==0.9.17
jsonpointer==2.4
jsonschema==4.21.1
jsonschema-specifications==2023.12.1
jupyter-events==0.9.0
jupyter_client==8.6.0
jupyter_core==5.7.1
jupyter_server==2.12.5
jupyter_server_terminals==0.5.2
jupyterlab==4.1.2
jupyterlab_pygments==0.3.0
jupyterlab_server==2.25.3
MarkupSafe==2.1.5
matplotlib-inline==0.1.6
mistune==3.0.2
nbclient==0.9.0
nbconvert==7.16.1
nbformat==5.9.2
nest-asyncio==1.6.0
notebook_shim==0.2.4
overrides==7.7.0
packaging==23.2
pandocfilters==1.5.1
parso==0.8.3
pexpect==4.9.0
platformdirs==4.2.0
prometheus_client==0.20.0
prompt-toolkit==3.0.43
psutil==5.9.8
ptyprocess==0.7.0
pure-eval==0.2.2
pycparser==2.21
Pygments==2.17.2
python-dateutil==2.8.2
python-json-logger==2.0.7
PyYAML==6.0.1
pyzmq==25.1.2
referencing==0.33.0
requests==2.31.0
rfc3339-validator==0.1.4
rfc3986-validator==0.1.1
rpds-py==0.18.0
Send2Trash==1.8.2
six==1.16.0
sniffio==1.3.1
soupsieve==2.5
stack-data==0.6.3
terminado==0.18.0
tinycss2==1.2.1
tomli==2.0.1
tornado==6.4
traitlets==5.14.1
types-python-dateutil==2.8.19.20240106
typing_extensions==4.10.0
uri-template==1.3.0
urllib3==2.2.1
wcwidth==0.2.13
webcolors==1.13
webencodings==0.5.1
websocket-client==1.7.0

Thanks for any help

This is lacking details. What do you mean by still, what do you mean by works? Uninstalled server extensions will mostly still work until you restart the server as they are loaded up in the memory (the same way you can remove your disk when your PC is running); the completion will still work without lsp because there is a native completion provider in JupyterLab.

2 Likes

Thank you krassowski,for inform me that “there is a native completion provider in JupyterLab”. I didn’t know this before. Is it called completer-extension? what the difference between it and lsp? if I had lsp installed ( jupyterlab-lsp, jupyterlab-lsp and language server),lsp takes precedence of native completion provider ?

Thanks

lsp takes precedence of native completion provider

this depends on your settings but by default the LSP completion provider will be used alongside the default completion providers (which are kernel completion provider and context completion provider).

what the difference between it and lsp

The kernel completion provider can only provide completions when the kernel is running but not when it is shut down, or busy doing computations; in general the kernel completions are based on runtime inference while LSP uses static analysis, which have their strengths and weknesses, but LSP also includes more details about completions (e.g. can annotate deprecated symbols, display more context about the source of the symbol etc). The quality of kernel completions will depend on the implmentation in given kernel, quality of the LSP completions will depend on specific language server.
The context completion provider is rather dummy, it just takes the code in the editor and uses all tokens in it as possible completions (in simple terms it takes all words from the text).