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

Improve TS auto import label #98228

Closed
plaa opened this issue May 20, 2020 · 10 comments · Fixed by #109842
Closed

Improve TS auto import label #98228

plaa opened this issue May 20, 2020 · 10 comments · Fixed by #109842
Assignees
Labels
insiders-released Patch has been released in VS Code Insiders suggest IntelliSense, Auto Complete under-discussion Issue is under discussion for relevance, priority, approach ux User experience issues
Milestone

Comments

@plaa
Copy link

plaa commented May 20, 2020

  • VSCode Version: 1.45.1
  • OS Version: macOS Mojave 10.14.6

Steps to Reproduce:

Recently, the autocomplete auto import text has become cropped so short as to be completely useless. In many cases over the past couple of days, I've had the option to import 2-4 same-named classes/components. Normally, I can select the correct one based on the additional text

Auto import from 'react-native'

Now the package name is cropped to the same text for all options:

Auto import from 'react...

This makes the auto-import feature completely useless (one of the most important features in an IDE).

See example:
autoimport-broken

  1. Create project with React Native + React Navigation
  2. Type in 'Header' and cmd+space to open autocomplete
    (It may be that additional conditions apply, for example what the other options presented in the list would be.)

Does this issue occur when all extensions are disabled?: Yes

@IllusionMH
Copy link
Contributor

Press Cmd+Space again to see detailed info for suggestions.

Changing width of suggestions box already tracked in #29757 and #29126

@jrieken jrieken added suggest IntelliSense, Auto Complete ux User experience issues labels May 26, 2020
@Fasani

This comment has been minimized.

@lnikell

This comment has been minimized.

@jecarlsen
Copy link

jecarlsen commented Jun 23, 2020

Since #100832 was closed (with reference to some obscure problem from 2017), this ticket is the closest I could come to the new issue.
The suggestion-list window is just too narrow for the info that is being presented there.
Introducing a new feature to put more information there made the situation worse.
It's simple not enough room to read the fully qualified names many are using.

Snippets for PS/XML and other languages. (Sample image included)

Alternative fixes :

  • Allow us to turn OFF the 'descriptions' in column 2 of the snippet list.
  • Allow people to customize the width of the list-window.
  • Roll back the feature that gave us 2 columns instead of just 1 column (with the name only).

I sincerely need a workaround or fix. Very frustrating.
image

@plaa

This comment has been minimized.

@jrieken

This comment has been minimized.

@plaa

This comment has been minimized.

@plaa

This comment has been minimized.

@jrieken jrieken added the under-discussion Issue is under discussion for relevance, priority, approach label Jul 2, 2020
@jrieken jrieken added this to the November 2020 milestone Oct 27, 2020
@jrieken
Copy link
Member

jrieken commented Oct 27, 2020

Just a heads-up that for the suggest widget and its details parts are going to be resizable. See #29126. This issue will all about the specific TS case and how to improve the situation for auto-importing modules

@jrieken jrieken changed the title Intellisense auto-import useless because source package name is cropped Improve TS auto import label Oct 30, 2020
@jrieken
Copy link
Member

jrieken commented Nov 2, 2020

@mjbvz There might be more to it and things I don't know esp. the doc for tsEntry.source says it might not be human readable but it kinda looks nice already.

diff --git a/extensions/typescript-language-features/src/languageFeatures/completions.ts b/extensions/typescript-language-features/src/languageFeatures/completions.ts
index 73f54f20c6..bf6916c925 100644
--- a/extensions/typescript-language-features/src/languageFeatures/completions.ts
+++ b/extensions/typescript-language-features/src/languageFeatures/completions.ts
@@ -62,6 +62,9 @@ class MyCompletionItem extends vscode.CompletionItem {
 			// De-prioritze auto-imports
 			// https://github.com/microsoft/vscode/issues/40311
 			this.sortText = '\uffff' + tsEntry.sortText;
+
+			this.label2 = { name: tsEntry.name, qualifier: vscode.workspace.asRelativePath(tsEntry.source) };
+
 		} else {
 			this.sortText = tsEntry.sortText;
 		}

Screenshot 2020-11-02 at 12 37 51

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
insiders-released Patch has been released in VS Code Insiders suggest IntelliSense, Auto Complete under-discussion Issue is under discussion for relevance, priority, approach ux User experience issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants
@Fasani @IllusionMH @plaa @jrieken @lnikell @aeschli @jecarlsen and others