Use completion item detail in completion renderer #492
Labels
enhancement
New feature or request
feature:completion
good first issue
Good for newcomers
package:jupyterlab-lsp
Completion item provides
detail
property which includes language-specific detail information about the completion, e.g. the module from which a function was imported.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
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.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
The text was updated successfully, but these errors were encountered: