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

Intellisense offers wrong suggestion after dismissal and re-opening in context of switch-case #18359

Closed
JoshVarty opened this issue Mar 31, 2017 · 3 comments
Assignees
Milestone

Comments

@JoshVarty
Copy link
Contributor

Version Used: 15.0.0.+26228.9

Steps to Reproduce:

public sealed class VSConstants
{
    public enum VSStd2KCmdID
    {
        TYPECHAR = 1,
    }

    public enum VSStd97CmdID
    {
        Expand = 187,
    }
}

class Program
{
    static void Main(string[] args)
    {
        switch((VSConstants.VSStd97CmdID)5)
        {
             //Begin typing here vvvv
            case VSConstants.
        }
    }
}
  1. Type vss
  2. Observe completion list is correct.
  3. Dismiss completion. (Esc)
  4. Open completion (Ctr-space)
  5. Observe that incorrect item has been inserted and selected in list.

image

@CyrusNajmabadi
Copy link
Member

@rchande didn't you fix something where we were offering the full enum preselect when a person was typing after a dot?

@Pilchie Pilchie added this to the 15.3 milestone Apr 3, 2017
@rchande
Copy link
Contributor

rchande commented Apr 10, 2017

@CyrusNajmabadi This case is interesting. We correctly type infer that VSConstants.VSStd97CmdID is required and call ToMinimalDisplayString on it. However, ToMinimalDisplayString doesn't account for any qualification that might appear before the position we pass in. It produces the most sensible minimal display string, which is, in fact, `VSConstants.VSstd97CmdID. We'll need to do some work to trim off any qualification that's already present. Do you know if we have any helpers that can already do that?

@JoshVarty
Copy link
Contributor Author

I'm not sure if this is related, but in the following code, the suggestion VSStd2K is missing from the list.

Note: I cannot get this to repro with the above code, but it repros if you add a reference to Microsoft.VisualStudio.Shell.15.0

var guid = VSConstants.VSStd; //<-Bring up Intellisense here

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants