jupyterlab-lsp icon indicating copy to clipboard operation
jupyterlab-lsp copied to clipboard

Autocomplete from file system strings doesn't complete correctly

Open sntgluca opened this issue 3 years ago • 4 comments

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: Screenshot 2021-11-05 at 11 05 03

Screenshot 2021-11-05 at 11 05 10

Reproduce

  1. On a notebook, or editor start typing a path as a string
  2. Click to autocomplete
  3. 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.

sntgluca avatar Nov 05 '21 10:11 sntgluca

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.

krassowski avatar Nov 05 '21 10:11 krassowski

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?

sntgluca avatar Nov 07 '21 09:11 sntgluca

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.

krassowski avatar Nov 07 '21 09:11 krassowski

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?

sntgluca avatar Nov 07 '21 10:11 sntgluca