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 bug writing 'Task.' #10502

Closed
mkrueger opened this issue Apr 12, 2016 · 3 comments
Closed

Completion bug writing 'Task.' #10502

mkrueger opened this issue Apr 12, 2016 · 3 comments

Comments

@mkrueger
Copy link
Contributor

It's a bug from the monodevelop bug tracker but affects VS.NET as well.

See: http://screencast.com/t/Xebulsw8

Seems to be always in that case:

Task.$ await Task

@DustinCampbell
Copy link
Member

This is a tricky parser issue. The problem is that the parser is parsing as a local declaration there the variable name is Task and the type is Task.await. Passing to the compiler team to see if there's something better we can do here.

@Suchiman
Copy link
Contributor

Suchiman commented Apr 21, 2016

I'm not sure if that's the same problem but here's a very similiar case:

using System.Threading.Tasks;

namespace IntelliSenseRepro
{
    public class SharingController
    {
        private Test Service => new Test();

        public async Task Test()
        {
            $
            await Service.SaveChangesAsync();
        }
    }

    public class Test
    {
        public async Task SaveChangesAsync() { }
    }
}

Go to $ and type Service.. Everything in the method is red underlined then 😉 and no IntelliSense 😦

If you change the Code to:

using System.Threading.Tasks;

namespace IntelliSenseRepro
{
    public class SharingController
    {
        public async Task Test()
        {
            Test Service = new Test();
            $
            await Service.SaveChangesAsync();
        }
    }

    public class Test
    {
        public async Task SaveChangesAsync() { }
    }
}

then everything after $ is still red squigglied but at least IntelliSense pops up and gives correct completion.

@jaredpar jaredpar added this to the 2.0 (RC) milestone May 9, 2016
@gafter gafter modified the milestones: 2.1, 2.0 (RC) Jul 21, 2016
@jaredpar
Copy link
Member

jaredpar commented Feb 8, 2017

@gafter recovery work appears to have fixed this too. No longer repros on VS 2017.

@jaredpar jaredpar closed this as completed Feb 8, 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

5 participants