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

Use completion item detail in completion renderer #492

Closed
krassowski opened this issue Jan 24, 2021 · 0 comments · Fixed by #549
Closed

Use completion item detail in completion renderer #492

krassowski opened this issue Jan 24, 2021 · 0 comments · Fixed by #549

Comments

@krassowski
Copy link
Member

krassowski commented Jan 24, 2021

Completion item provides detail property which includes language-specific detail information about the completion, e.g. the module from which a function was imported.

  1. It should be displayed by default instead of type text if available (the type is already shown by the icon); We can modify the <li> element with the completion item after its creation, or modify how it is created here:

    https://github.com/krassowski/jupyterlab-lsp/blob/d8b670528605f4f736da08c965c42b82688d0981/packages/jupyterlab-lsp/src/features/completion/completion_handler.ts#L137

  2. the user should be able to choose what they want to be displayed (maybe there options: detail, type, whichever available); this can happen later, but the access to settings in the renderer is already possible using the this.options.integrator.settings:

    https://github.com/krassowski/jupyterlab-lsp/blob/d8b670528605f4f736da08c965c42b82688d0981/packages/jupyterlab-lsp/src/features/completion/renderer.ts#L78

    to add a new setting one should modify the schema/completion.json file and follow with jlpm build:schema from the repository root.

  3. the resolve request needs to be updated to copy the detail from response, as is the documentation here:

    https://github.com/krassowski/jupyterlab-lsp/blob/d8b670528605f4f736da08c965c42b82688d0981/packages/jupyterlab-lsp/src/features/completion/renderer.ts#L25

@krassowski krassowski changed the title Use completion item detail in completion rendered Use completion item detail in completion renderer Jan 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant