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

Show package information in code completion #5225

Open
ntluong95 opened this issue Oct 30, 2024 · 2 comments
Open

Show package information in code completion #5225

ntluong95 opened this issue Oct 30, 2024 · 2 comments
Labels
area: completions Issues related to Completions area: kernels Issues related to Jupyter kernels and LSP servers lang: r

Comments

@ntluong95
Copy link

System details:

Positron and OS details:

Positron Version: 2024.11.0 (system setup) build 116
Code - OSS Version: 1.93.0
Commit: 8b1688a
Date: 2024-10-28T02:47:45.218Z
Electron: 30.4.0
Chromium: 124.0.6367.243
Node.js: 20.15.1
V8: 12.4.254.20-electron.0
OS: Windows_NT x64 10.0.22621

Interpreter details:

R 4.3.2

Describe the issue:

In Rstudio, when you call function, methods, it will show for you from where the method come from. It will be nice if we can have it in Positron

Steps to reproduce the issue:

Image

Image

Expected or desired behavior:

Image

Image

@lionel- lionel- added lang: r area: kernels Issues related to Jupyter kernels and LSP servers area: completions Issues related to Completions labels Oct 31, 2024
@lionel- lionel- added this to the 2024.12.0 Pre-Release milestone Oct 31, 2024
@lionel-
Copy link
Contributor

lionel- commented Oct 31, 2024

I agree it's very useful to see the package in the completion list.

There are two relevant fields for CompletionItem:

  • detail, which we currently use for displaying function parameters. This is the legacy field in the LSP spec. In the VSCode/Positron UI, it's hidden by default and only appears for the item currently selected.

  • label_details, a newer field discussed in Consider showing completion item detail if available for all list items microsoft/vscode#39441. It has two sub-fields detail and description. The former is meant for function parameters and is appended directly to the label without space (e.g. the label might be mean and label_details.detail would be (x, ...). The description field is shown on the right. Both of these fields are always shown at all times for all items in the completion lists.

When label_details is supplied, detail is ignored. The server can provide both so that older clients that only understand detail still work as before.

So I think we have the following options.

@ntluong95
Copy link
Author

That's fast, thanks so much @lionel- I agree that the parameter list there is usually useless, so good to replace by the package source information. Much more useful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: completions Issues related to Completions area: kernels Issues related to Jupyter kernels and LSP servers lang: r
Projects
None yet
Development

No branches or pull requests

2 participants