question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Investigate eagerly returning more information about suggestions

See original GitHub issue

Problem

Suggestions VS Code have three broad UX parts:

  • Name/label. Primary identifier for a suggestion, such as foo.
  • Details. Type information or auto import info, such as string.
  • Documentation. Js doc info and additional details about the suggestion item

Currently VS Code only shows the details of the currently active suggestion. This can be problematic in cases like auto imports, where multiple symbols may all have the same name:

Screen Shot 2020-01-17 at 11 26 30 AM

This design also reflects the design of the suggestion api:

  • completionInfo returns the entire list of suggestions, but only includes the name
  • completionEntryDetails returns the details and documentation for an individual suggestion

Investigation

With https://github.com/microsoft/vscode/issues/39441, VS Code is exploring letting languages/extensions return the details part of the suggestion eagerly. This would let VS Code show details for the entire list of suggestions instead of just for the active one. In the auto import case specifically, this would likely mean showing the file paths we would import from.

We would like the typescript team’s feedback on these idea and our current proposals:

  • What information would be most helpful to render in the main suggestion list?
  • How much overhead would returning this information add? Both in terms of message size and TS server computation time?

/cc @jrieken For VS Code apis /cc @amcasey @minestarks for VS

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:2
  • Comments:24 (22 by maintainers)

github_iconTop GitHub Comments

4reactions
mjbvzcommented, Feb 20, 2020

I’ve measuring the perf impact of the most simple approach possible: call completionEntryDetails with the entire list of completion items (this is one TS server request but returns data for many items)

In a empty project, this call takes ~3seconds for 1500 or so completion items. So clearly not a good solution!

Just a breakdown of simples of timings for completionEntryDetails:

  • 1 item - 5ms
  • 10 items - 25ms
  • 50 items - 110 ms
  • 100 items - 200ms
  • 200 items - 350ms
  • 500 items - 900ms

(Note that completionEntryDetails also returns JS Doc documentation and some additional data that our completion label proposal does not call for. What I was measuring here is very worst possible case)


@andrewbranch At the TS/Editor sync today, we though you may the person to investigate this on the TS side. Using the existing TS Server apis, would you be able to look into:

  • What easily accessibly data does TS currently have for the completions call that it does not send back to VS Code (such as the auto import source)

  • What would be the perf impact of sending back this data?

  • What would be the perf impact of returning all the information from the VS Code proposal (https://github.com/microsoft/vscode/issues/39441#issuecomment-575197886) except the signature

  • And what would be the perf impact of returning the signature as well (we expect this to be the most expensive part to generate properly)

1reaction
andrewbranchcommented, Apr 17, 2020

In my experiment I have called completionEntryDetails once, with CompletionDetailsRequestArgs that list all items that I have just received.

Interesting. I didn’t realize that the protocol accepted an array of items, because the language service does not—in the server code we just map over this list and do the full languageService.getCompletionEntryDetails() call for each.

Read more comments on GitHub >

github_iconTop Results From Across the Web

MQM 220 Exam 1 Flashcards - Quizlet
For now, management wants your recommendation: Which project is most likely to lead Tri-State into becoming more sustainable, but also provide a significant ......
Read more >
Summary and Analysis Chapter 4 - Frankenstein - Cliffs Notes
Believing his tenure at Ingolstadt was nearing an end, Victor thinks of returning home to Geneva. However, he launches into a new venue...
Read more >
Efficient Querying - EF Core - Microsoft Learn
This section details some common themes for making your queries ... and then examine its query plan via your database's favorite tool; ...
Read more >
Idaho murders update: 'Bright and awkward' suspect Bryan ...
“Mr Kohberger is eager to be exonerated of these charges and looks ... Moscow Police said that more information about the circumstances ...
Read more >
PAPPG Chapter II - National Science Foundation
Additional information on NSF auto-compliance checks can be found at: ... EAGER, RAISE, GOALI, Ideas Lab, FASED, conference, equipment, travel, center, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found