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

Implement eliding for paths/files #893

Merged
merged 4 commits into from
Jan 2, 2023

Conversation

krassowski
Copy link
Member

@krassowski krassowski commented Jan 2, 2023

References

Elide long path completions, fixes #787 and fixes jupyterlab/jupyterlab#12830

Code changes

The content of the first highlighted (<mark>ed) part is elided for paths

  • direction: rtl is used to reverse side of eliding
    • to prevent wrong placement of neutral BiDi characters (e.g. . or /) <bdo> tag wrapper is used for <mark> contents; the alternative, CSS unicode-bidi would also require an HTML wrapper, hence BDO tag is a simpler choice.
  • display:flex/flex-shrink: 1 is used to stretch the mark to as much as possible

I also explored a possibility of eliding of the middle part of the path based on separator, but there does not appear to be a good solution (which would have good performance with large number of matches).

User-facing changes

Long paths are elided. User can hover over the elided part to see title with full contents.

Screenshot from 2023-01-02 03-59-58

Backwards-incompatible changes

None

Chores

  • linted
  • tested
  • documented
  • changelog entry

@github-actions
Copy link

github-actions bot commented Jan 2, 2023

Binder 👈 Launch a binder notebook on branch krassowski/jupyterlab-lsp/elide-filepaths

caught on CI. It was only a problem for 3.7 because newer versions
of IPython include type information for all suggestions.
@krassowski
Copy link
Member Author

Windows failures are unrelated (#894).

@krassowski krassowski merged commit 3782976 into jupyter-lsp:master Jan 2, 2023
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 this pull request may close these issues.

Improve long completion UX code completion missing string for very long path completion
1 participant