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

code completion missing string for very long path completion

Open niuniudevp opened this issue 2 years ago • 4 comments

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! image

niuniudevp avatar Apr 07 '22 01:04 niuniudevp

For paths, truncating the start of the string would likely be a much better UX.

Might even be a better UX for everything :thinking:

dhirschfeld avatar Apr 07 '22 01:04 dhirschfeld

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 Annotation 2022-05-12 120934

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.

Keppl avatar May 12 '22 16:05 Keppl

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. image

Keppl avatar May 12 '22 16:05 Keppl

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).

krassowski avatar Aug 04 '22 13:08 krassowski