jupyterlab-lsp
jupyterlab-lsp copied to clipboard
code completion missing string for very long path completion
Description
When I try to type in a file path, if the path is vey long, the remaining path string will not be seen in code completion!

For paths, truncating the start of the string would likely be a much better UX.
Might even be a better UX for everything :thinking:
truncating the start of the string
From poking around, I think adding direction: rtl; at the end of .jp-Completer-match might do exactly that.
(https://github.com/jupyter-lsp/jupyterlab-lsp/blob/1f4c530a01e7b792ff717754437cbfc1bf227726/packages/completion-theme/style/index.css#L32

Mind I only checked from inside browser dev tools and by modifying static files of already built extension, but hopefully editing index.css should give same results. Don't know if there is any side-effects though.
Hmm, on the other hand it does cause an inverse of the issue if functions have a lot of arguments, and arguments are displayed. Not an issue with completions that don't display arguments though.

We could do that conditionally on the type of completion (if it is a path then direction: rtl; otherwise as it was). That would however require teaching kernel to send proper types for paths (https://github.com/ipython/ipython/issues/12820).