Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Path completion broken #667

Closed
michaelaye opened this issue Aug 19, 2021 · 7 comments · Fixed by #686
Closed

Path completion broken #667

michaelaye opened this issue Aug 19, 2021 · 7 comments · Fixed by #686

Comments

@michaelaye
Copy link
Contributor

michaelaye commented Aug 19, 2021

After installing jlab-lsp, path completion is broken for me.

I verified that after removing jlab-lsp it works again.

What happens is that the first letters already typed before triggering the completion are not being removed by the replacement, which results in having to edit the completed path, rendering it unusable.

Below are 2 screenshots showing what I typed just before and just after accepting the completion suggestion:

image

image

Versions:

# Name                    Version                   Build  Channel
jupyter                   1.0.0            py39h6e9494a_6    conda-forge
jupyter-lsp               1.4.1              pyhd8ed1ab_0    conda-forge
jupyter-server-mathjax    0.2.3              pyhd8ed1ab_0    conda-forge
jupyter-server-proxy      3.1.0              pyhd8ed1ab_0    conda-forge
jupyter_client            6.1.12             pyhd8ed1ab_0    conda-forge
jupyter_console           6.4.0              pyhd8ed1ab_0    conda-forge
jupyter_contrib_core      0.3.3                      py_2    conda-forge
jupyter_core              4.7.1            py39h6e9494a_0    conda-forge
jupyter_nbextensions_configurator 0.4.1            py39h6e9494a_2    conda-forge
jupyter_server            1.10.2             pyhd8ed1ab_0    conda-forge
jupyterlab                3.1.7              pyhd8ed1ab_0    conda-forge
jupyterlab-git            0.32.1             pyhd8ed1ab_0    conda-forge
jupyterlab-lsp            3.8.1              pyhd8ed1ab_0    conda-forge
jupyterlab_code_formatter 1.4.10             pyhd8ed1ab_1    conda-forge
jupyterlab_pygments       0.1.2              pyh9f0ad1d_0    conda-forge
jupyterlab_server         2.7.1              pyhd8ed1ab_0    conda-forge
jupyterlab_widgets        1.0.0              pyhd8ed1ab_1    conda-forge
python-language-server    0.36.2             pyhd8ed1ab_0    conda-forge
@krassowski
Copy link
Member

Thanks! I think this is because of the ~/ prefix... If the server returned the path with the prefix it should work well. We could either make it a special case if we knew that it is a path completion (but we don't since the server did not mark it as a File but as a Text) or we could fix it in the pyls language server.

@michaelaye
Copy link
Contributor Author

I confirmed that things work without the tilde.
Maybe this should work the same as without the server, where standard completion would be that the tilde is replaced at the first completion action (Path().expanduser() in case you use pathlib tools), and afterwards there's only an absolute path left.

@michaelaye
Copy link
Contributor Author

michaelaye commented Aug 19, 2021

ah no, absolute paths also fail:

image

I typed "/User" and pressed TAB and the completed "Users" did not replace the typed "User".

@michaelaye
Copy link
Contributor Author

is there a quick workaround? Or how can I actually temporarily deactivate the installed pyls? It becomes quite cumbersome to work with local data file discovery with this bug...

@michaelaye
Copy link
Contributor Author

Can one switch off path completion by lsp only?

@krassowski
Copy link
Member

I'm sorry I did not resolve it yet. I will look into it as soon as possible for me, which is the weekend 9-10 October. I added it to my calendar. Sorry again!

@krassowski
Copy link
Member

You can add "disableCompletionsFrom": ["LSP"] in Advanced Settings EditorCode Completion. I confirmed that this fixes the problem and it is only present for specific prefixes when merging completions from Kernel and LSP; sorry - these are using different coordinate systems and it's just hard to reconcile them in all edge cases. Working on it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants