jupyterlab-lsp
jupyterlab-lsp copied to clipboard
Autocomplete from file system strings doesn't complete correctly
Description
Dear @krassowski , when trying to autocomplete from a string, i.e. completing a file/directory name from the file system, the result is appended without cleaning up the existing string, leading to a duplication of the content.
So, if I search for /path/to/file/an_imp<tab>
to complete the file an_important_file.txt
I end up with /path/to/file/an_impan_important_file.txt
For instance:

Reproduce
- On a notebook, or editor start typing a path as a string
- Click
to autocomplete - Select the wanted autocomplete entry
Expected behavior
The final path should contain a correct path, not just the combination of the original string and the autocomplete one.
Context
- JupyterLab version: 3.1.18
- Jupyterlab-lsp version: 3.8.1
Required: installed server extensions
Paste the output from running `jupyter server extension list` (JupyterLab >= 3) or `jupyter serverextension list` (JupyterLab
Required: installed lab extensions
Paste the output from running `jupyter labextension list` from the command line here. You may want to sanitize the paths in the output.
Troubleshoot Output
Paste the output from running `jupyter troubleshoot` from the command line here. You may want to sanitize the paths in the output.
Command Line Output
Paste the output from your command line running `jupyter lab` here, use `--debug` if possible.
Browser Output (recommended for all interface issues)
Paste the output from your browser JavaScript console replacing the text in here.To learn how to open the developer tools in your browser: https://developer.mozilla.org/en-US/docs/Learn/Common_questions/What_are_browser_developer_tools#How_to_open_the_devtools_in_your_browser If too many messages accumulated after many hours of working in JupyterLab, consider refreshing the window and then reproducing the bug to reduce the noise in the logs.
The path completions were improved in v3.9.0 and we are currently on v3.9.1. Please upgrade to the latest version of the extension.
Hi @krassowski ,
Things work much better on v3.9.1, and the error I reported has indeed been fixed. I apologise for not having tried with the latest version.
I wish to share other issue though: I notice that string completion still require kernel lookup and
- I can't make it work on the editor;
- only work on a notebook with the defaults. It stops working if I disable Kernel autocomplete via
{"disableCompletionsFrom": ["Kernel"],
}
This happens on both my Mac and Linux CentOS7 instances, even on v3.9.1. Is it something you expect?
This might be a limitation of the LSP server you use - it might not be providing the path completions (the kernel generally knows more about your environment than the LSP server). It's hard to tell without more details.
Thanks for answering @krassowski,
What information can I share with you? I am using:
jupyter-lsp 1.5.0 jupyterlab-lsp 3.9.1 python-lsp-jsonrpc 1.0.0 python-lsp-server 1.3.0.dev (your fork if I am not mistaken)
Here's my autocomplete config:
{
"showDocumentation": true,
"caseSensitive": true,
"continuousHinting": true,
"waitForBusyKernel": false,
"kernelCompletionsFirst": false,
"kernelResponseTimeout": 6000,
"disableCompletionsFrom": [], //["LSP", "Kernel"]
}
Does it help? Am I missing something obvious?