Skip to content

Improve TS auto import label #98228

Closed

Description

@plaa
  • 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

Activity

  1. IllusionMH commented on May 20, 2020

    @IllusionMH
    Contributor

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

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

  2. Fasani commented on Jun 23, 2020

    @Fasani
  3. lnikell commented on Jun 23, 2020

    @lnikell
  4. jecarlsen commented on Jun 23, 2020

    @jecarlsen

    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

  5. plaa commented on Jun 25, 2020

    @plaa
    Author
  6. jrieken commented on Jun 25, 2020

    @jrieken
  7. plaa commented on Jun 25, 2020

    @plaa
    Author
  8. plaa commented on Jun 25, 2020

    @plaa
    Author
  9. jrieken commented on Oct 27, 2020

    @jrieken
    Contributor

    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

  10. changed the title [-]Intellisense auto-import useless because source package name is cropped[/-] [+]Improve TS auto import label[/+] on Oct 30, 2020
  11. jrieken commented on Nov 2, 2020

    @jrieken
    Contributor

    Matt Bierner (@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

  12. added
    unreleasedPatch has not yet been released in VS Code Insiders
    insiders-releasedPatch has been released in VS Code Insiders
    and removed
    unreleasedPatch has not yet been released in VS Code Insiders
    on Nov 13, 2020
  13. locked and limited conversation to collaborators on Dec 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

insiders-releasedPatch has been released in VS Code InsiderssuggestIntelliSense, Auto Completeunder-discussionIssue is under discussion for relevance, priority, approachuxUser experience issues

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions