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

Completion list incorrectly includes full signatures for members #1491

Closed
Leopotam opened this issue May 18, 2017 · 13 comments
Closed

Completion list incorrectly includes full signatures for members #1491

Leopotam opened this issue May 18, 2017 · 13 comments

Comments

@Leopotam
Copy link
Contributor

Environment data

dotnet --info output:

.NET Command Line Tools (1.0.1)

Product Information:
 Version:            1.0.1
 Commit SHA-1 hash:  005db40cd1

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  10.12
 OS Platform: Darwin
 RID:         osx.10.12-x64
 Base Path:   /usr/local/share/dotnet/sdk/1.0.1

VS Code version:
1.13.0-insider (1.13.0-insider) 3bb9b5314ef50bd8225aba0565cadc6ca19bc821 2017-05-18T06:18:32.269Z

C# Extension version:
1.10.0-beta3 dc1908d

Steps to reproduce

  1. Enter "if", it will show "if" snippet item in autocomplete list.
  2. Enter space as part of "if (xxx)" expression, it will show methods list, "if" snippets will disappear.
  3. Enter "(" as part of "if (xxx)" expression.

Expected behavior

Autocomplete with closing pair of parenthesis ")", or nothing. Even I try to insert "IF"-snippet with tab-key - it will do it only on second attempt (first one is just closing autocomplete popup). Totally not usable when you write condition expression in fast manner.

Actual behavior

Automatic insertion of first item at autocomplete list.

@DustinCampbell
Copy link
Member

Unfortunately, I'm unable to reproduce this. I tried the following:

  1. Create new C# file.

  2. Type class and press TAB followed by ENTER to expand the 'class' snippet and position the caret inside.

  3. Type svm and press TAB to create a new static Main method with the caret positioned inside.

  4. Type if to display the completion list with the 'if' snippet selected.

    image

  5. Press SPACE. At this point your repro steps state that a completion list of methods appears, but it doesn't (and shouldn't).

Could you clarify your repro steps? Thanks!

@DustinCampbell DustinCampbell changed the title Intellisense: autocomplete issue for "IF" expression. Snippets: autocomplete issue for "IF" expression. May 18, 2017
@Leopotam
Copy link
Contributor Author

@DustinCampbell very strange behaviour, btw. Looks like it depends on base class methods. I recorded video with issue (it raised only on first attempt).

@bernardbr
Copy link

bernardbr commented May 18, 2017

@DustinCampbell in my case happens it:
image

I write if and press space then if snippet appears and when I press any key its happen:
image

@DustinCampbell
Copy link
Member

@Leopotam: Thanks for the video. That is very strange behavior. 😄 I notice that you're using VS Code Insiders. I wonder if the issues is there. I'll install and take a look.

@bernardbr: The behavior you described is different than what @Leopotam is seeing. Note that in your example there is code after the "if".

@bernardbr
Copy link

bernardbr commented May 18, 2017

@DustinCampbell

Yeah, I realized that now ... I'm sorry.
But, it's a strange behavior. It's happening with using statement too.
But thinking now, maybe it isn't a behavior of omnisharp. I'm gonna try to do the same with only omnisharp extension enabled.

@Leopotam
Copy link
Contributor Author

@DustinCampbell class was created in unity3d solution - its why i can used UnityEngine.MonoBehaviour class. All methods at popup list are valid methods of MonoBehaviour type.

@DustinCampbell
Copy link
Member

@Leopotam: I don't have Unity set up to precisely repro. Do you see the same problem on the RTM version of VS Code?

@bernardbr
Copy link

@DustinCampbell Sorry about my first comment. This behavior wasn't of Omnisharp. I disabled all other extensions and the problems gone.

Thanks for your attention!

@DustinCampbell
Copy link
Member

@bernardbr: Glad to hear it -- thanks @bernardbr!

@Leopotam
Copy link
Contributor Author

Leopotam commented May 18, 2017

@DustinCampbell i uploaded minimal unity3d-solution, you can try to reproduce issue on it.

@DustinCampbell
Copy link
Member

Thanks! I can totally repro with this solution.

@DustinCampbell
Copy link
Member

OK. I can repro with a smaller code example:

class Base
{
    public void Invoke(float value) { }
}

class Derived : Base
{
    public void M()
    {
        // if here
    }
}

@DustinCampbell DustinCampbell changed the title Snippets: autocomplete issue for "IF" expression. Completion list doesn't specify filter text correctly May 18, 2017
@DustinCampbell DustinCampbell self-assigned this May 18, 2017
@DustinCampbell DustinCampbell added this to the 1.10 milestone May 18, 2017
@DustinCampbell
Copy link
Member

OK. I see what's wrong.

@DustinCampbell DustinCampbell changed the title Completion list doesn't specify filter text correctly Completion list incorrectly includes full signatures for members May 19, 2017
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

3 participants