GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — favor local types and values in autocomplete popup over ambients declaration · Issue #15024 · microsoft/TypeScript

favor local types and values in autocomplete popup over ambients declaration #15024

New issue
Copy link
New issue
Copy link
Closed
#31484
Closed
favor local types and values in autocomplete popup over ambients declaration#15024
#31484
Copy link
Assignees
sheetalkamat
Labels
Domain: LS: Completion ListsThe issue relates to showing completion lists in an editorThe issue relates to showing completion lists in an editorFixedA PR has been merged for this issueA PR has been merged for this issueSuggestionAn idea for TypeScriptAn idea for TypeScriptVS Code PriorityCritical issues that VS Code needs fixed in the current TypeScript milestoneCritical issues that VS Code needs fixed in the current TypeScript milestone
Milestone
TypeScript 3.5.0

Description

@zpdDG4gta8XKpMCd
ZpdDG4gta (zpdDG4gta8XKpMCd)
opened on Apr 5, 2017
Issue body actions

it's not clear to me what drives the order of the list of autocomplete popup suggestions, i wish my local types and values were listed first, and ambients came after them

Reacted by Aluan Haddad, Tingan Ho, Matt Bierner, Marin Marinov, Florian Bienefelt, Sami, Nicolas HENRY, Tomasz Błachut, Alexey Morozov, movedoa and 13 more

Activity

Next
  1. Ryan Cavanaugh (RyanCavanaugh)
    added
    Needs InvestigationThis issue needs a team member to investigate its status.This issue needs a team member to investigate its status.
    on May 24, 2017
  2. Matt Bierner (mjbvz)
    added
    VS Code TrackedThere is a VS Code equivalent to this issueThere is a VS Code equivalent to this issue
    on Jun 30, 2017
  3. mjbvz commented on Jun 30, 2017

    @mjbvz
    Matt Bierner (mjbvz)
    on Jun 30, 2017
    Contributor
    More actions

    This was reported against VSCode recently as well: microsoft/vscode#29613

    For code such as:

    var cancel = 123
    can|

    The suggestions for can have the same sort text:

     {
            "name": "cancel",
            "kind": "var",
            "kindModifiers": "",
            "sortText": "0"
        },
        {
            "name": "cancelAnimationFrame",
            "kind": "function",
            "kindModifiers": "declare",
            "sortText": "0"
        }
    

    I believe that variables and parameters should have a higher sort text (or that globals should have a lower sort text)

    Reacted by Marin Marinov, Mike Pugh and Sami
  4. mhegazy commented on Aug 29, 2017

    @mhegazy
    Mohamed Hegazy (mhegazy)
    on Aug 29, 2017
    Contributor
    More actions

    A feature that VS has today is remembering the last entry the user selected in the completion list. so the first time you type cancel it does not get it, but next time it gets a preferential treatment. I think this is a general feature that would be beneficial to VSCode users in general given the locality of reference for variables in general, and less disorienting as reordering based on scope.

    animation

    Reacted by Sami
  5. mhegazy commented on Aug 29, 2017

    @mhegazy
    Mohamed Hegazy (mhegazy)
    on Aug 29, 2017
    Contributor
    More actions

    Matt Bierner (@mjbvz) thoughts?

  6. Mohamed Hegazy (mhegazy)
    added
    Needs More InfoThe issue still hasn't been fully clarifiedThe issue still hasn't been fully clarified
    SuggestionAn idea for TypeScriptAn idea for TypeScript
    and removed
    Needs InvestigationThis issue needs a team member to investigate its status.This issue needs a team member to investigate its status.
    on Aug 29, 2017
  7. lifehackett commented on Sep 22, 2017

    @lifehackett
    lifehackett
    on Sep 22, 2017
    More actions

    I'd still prefer local scope to get higher weighting. The remembering of the last selection only solves a small subset of the use cases that I care about.

    Reacted by Mike Pugh, brerneto and suchoss
  8. mjbvz commented on Jan 9, 2019

    @mjbvz
    Matt Bierner (mjbvz)
    on Jan 9, 2019
    Contributor
    More actions

    VS Code has added support for remembering suggestions with the editor.suggestSelection setting.

    I still think that adding some basic sorting based on scope would be very helpful. Daniel Rosenwasser (@DanielRosenwasser) Can we revisit this feature request?

    Reacted by Daniel Rosenwasser and Marin Marinov
  9. Daniel Rosenwasser (DanielRosenwasser)
    assigned
    Sheetal Nandi (sheetalkamat)
    on Jan 10, 2019
  10. Daniel Rosenwasser (DanielRosenwasser)
    removed
    Needs More InfoThe issue still hasn't been fully clarifiedThe issue still hasn't been fully clarified
    on Jan 10, 2019
  11. Daniel Rosenwasser (DanielRosenwasser)
    added this to the TypeScript 3.4.0 milestone on Jan 10, 2019
  12. Daniel Rosenwasser (DanielRosenwasser)
    added
    Domain: LS: Completion ListsThe issue relates to showing completion lists in an editorThe issue relates to showing completion lists in an editor
    on Jan 10, 2019
  13. Matt Bierner (mjbvz)
    added
    VS Code PriorityCritical issues that VS Code needs fixed in the current TypeScript milestoneCritical issues that VS Code needs fixed in the current TypeScript milestone
    on Jan 24, 2019
  14. 1 remaining item

  15. Ryan Cavanaugh (RyanCavanaugh)
    modified the milestones: TypeScript 3.4.0, TypeScript 3.5.0 on Mar 14, 2019
  16. RyanCavanaugh commented on Mar 14, 2019

    @RyanCavanaugh
    Ryan Cavanaugh (RyanCavanaugh)
    on Mar 14, 2019
    Member
    More actions

    Sheetal Nandi (@sheetalkamat) this is something we'd like to deliver for 3.5 specifically

  17. mjbvz commented on Mar 22, 2019

    @mjbvz
    Matt Bierner (mjbvz)
    on Mar 22, 2019
    Contributor
    More actions

    More VS Code feedback related to suggestion sort order and locality: microsoft/vscode#47727

  18. zpdDG4gta8XKpMCd commented on Mar 25, 2019

    @zpdDG4gta8XKpMCd
    ZpdDG4gta (zpdDG4gta8XKpMCd)
    on Mar 25, 2019
    Author
    More actions

    there is also a very annoying thing with remembering-last-entry bonus:

    • say i needed [].filter but by accident i picked [].fill now the fill gets preference over filter and gets on the way even more often, so i pick it by accident even more, and it all goes in a vicious circle

    how do i unfavor some accidental picks?

    Reacted by SlurpTheo and Agostino Carandente
  19. SlurpTheo commented on Apr 11, 2019

    @SlurpTheo
    SlurpTheo
    on Apr 11, 2019
    More actions

    ZpdDG4gta (@zpdDG4gta8XKpMCd)

    how do i unfavor some accidental picks?

    If you Undo (Ctrl+Z) after accidentally selecting fill, I'd expect it to not leave fill in that "last list".

    Reacted by Adam Rutkowski
  20. RyanCavanaugh commented on Apr 18, 2019

    @RyanCavanaugh
    Ryan Cavanaugh (RyanCavanaugh)
    on Apr 18, 2019
    Member
    More actions

    The ordering we think might be best:

    • Things from the lexical scope that are declared in the current file (including top-level variables in a script file)
    • Suggested class members
    • Things from global lexical scope and keywords
    • Auto-import suggestions

    Caveat: "real" things (non-suggestions) should always shadow suggestions

    Reacted by Nicolas HENRY, ZpdDG4gta, Andrii Dieiev, Adam Rutkowski, Sean May, Benas Svipas and Agostino Carandente
  21. sheetalkamat commented on May 16, 2019

    @sheetalkamat
    Sheetal Nandi (sheetalkamat)
    on May 16, 2019
    Member
    More actions

    Ryan Cavanaugh (@RyanCavanaugh) Matt Bierner (@mjbvz)
    In example from #30013 making Things from the lexical scope that are declared in the current file (including top-level variables in a script file) as first makes suggested class members render

    image

    Also what happens to javascript symbols. Current behavior is that everything except JavaScript has "0" and JavaScript symbols are "1". Does JavaScript come after auto import ?

  22. mjbvz commented on May 17, 2019

    @mjbvz
    Matt Bierner (mjbvz)
    on May 17, 2019
    Contributor
    More actions

    Yeah that doesn't feel right. We should either:

    • Merge the class member and lexical scope precedences.
    • Introduce two levels of lexical scoping:
      • Locals (things from inside the current method)
      • class members
      • File Lexical scope
      • global lexical scope and keywords
      • Auto-import suggestions

    The first approach definitely seems more straightforward. VS Code's suggestion sorting should also help out so that better matches are shown first

    For the second point, the javascript symbol suggestions (we call them name suggestions in vscode) should probably have the lowest precedence. They are sort of the equivalent of VS Code's word based suggestions, which also have very low precedence and are only really meant to show up when no other suggestions match

  23. zpdDG4gta8XKpMCd commented on May 17, 2019

    @zpdDG4gta8XKpMCd
    ZpdDG4gta (zpdDG4gta8XKpMCd)
    on May 17, 2019
    Author
    More actions

    how about we give it as a configurable option?

    something like:

    {
        "auto-completion-priorities": ["locals", "members", "lexical", "ambients", "imports"]
    }

    or

    {
        "auto-completion-priorities": "merged"
    }
  24. zpdDG4gta8XKpMCd commented on May 17, 2019

    @zpdDG4gta8XKpMCd
    ZpdDG4gta (zpdDG4gta8XKpMCd)
    on May 17, 2019
    Author
    More actions

    it would be nice to have some visible separation between the groups (shades of background)

  25. zpdDG4gta8XKpMCd commented on May 17, 2019

    @zpdDG4gta8XKpMCd
    ZpdDG4gta (zpdDG4gta8XKpMCd)
    on May 17, 2019
    Author
    More actions

    better yet first N.. something items of each group with an option to dig deeper:

    aaaa
    aaab
    aaac
    aaad
    ... more locals
    bbba
    bbbb
    bbbc
    bbbd
    ... more globals
    

    and please make N configurable (per each group)

    ... looks like an overkill, disregard please

  26. Sheetal Nandi (sheetalkamat)
    added a commit that references this issue on May 20, 2019

    Add sortText depending scope of symbols

    This issue will close once commit 00cea41 is merged into the 'main' branch.
    00cea41
  27. Sheetal Nandi (sheetalkamat)
    added
    FixedA PR has been merged for this issueA PR has been merged for this issue
    on May 20, 2019
  28. Sheetal Nandi (sheetalkamat)
    closed this as completedin #31484on May 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @sheetalkamat
    Sheetal Nandi (sheetalkamat)

Labels

Domain: LS: Completion ListsThe issue relates to showing completion lists in an editorThe issue relates to showing completion lists in an editorFixedA PR has been merged for this issueA PR has been merged for this issueSuggestionAn idea for TypeScriptAn idea for TypeScriptVS Code PriorityCritical issues that VS Code needs fixed in the current TypeScript milestoneCritical issues that VS Code needs fixed in the current TypeScript milestone

Type

No type

Projects

No projects

    Milestone

    • TypeScript 3.5.0

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.