Bug 3973 - code completion forgets context if text is deleted
Summary: code completion forgets context if text is deleted
Status: RESOLVED DUPLICATE of bug 3578
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: C# Binding ()
Version: unspecified
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Mike Krüger
URL:
Depends on:
Blocks:
 
Reported: 2012-03-19 13:42 UTC by Csaba Halász
Modified: 2012-04-05 13:03 UTC (History)
1 user (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED DUPLICATE of bug 3578

Description Csaba Halász 2012-03-19 13:42:15 UTC
Given this sample code:

	class TestClass
	{
		static void Main()
		{
			IDisposable d = null;
			d<caret>
		}
	}

If you type the . (dot) it will correctly list the members, let it insert Dispose so you have:

	class TestClass
	{
		static void Main()
		{
			IDisposable d = null;
			d.Dispose<caret>
		}
	}

Now delete the whole Dispose word by backspacing until the dot:

	class TestClass
	{
		static void Main()
		{
			IDisposable d = null;
			d.<caret>
		}
	}

Now type a letter D and the completion list will pop up with type names instead of the expected member list.
Comment 1 Mike Krüger 2012-03-20 06:29:01 UTC
fixed.
Comment 2 Csaba Halász 2012-04-02 17:08:28 UTC
The original problem is indeed fixed, but here is a new test case:

    class TestClass
    {
        static void Main(<caret>)
        {
        }
    }

You want "Main(string[] args)", as usual. So start typing "s" and you get the completion popup but accidentally select "struct" (which probably shouldn't even be listed, by the way). So now you have "Main(struct<caret>)" and you decide to backspace until you have just "Main(str<caret>)". Then try to bring up the completion by ctrl+space but nothing happens. You have to delete all of the inserted text before you can get a completion list again and even then only by typing "s" and not by ctrl+space.
Comment 3 Csaba Halász 2012-04-03 12:21:10 UTC
Another problem case:

    class TestClass
    {
        static void Main(string[] args)
        {
            string[] foo = new string[] { "hello" };
            for(int i = 0; i != <caret>
        }
    }

First time around, the completion offers both "args" and "foo" among other things. If you accept either one and then delete it, the next time "args" is no longer in the list, but "foo" is.
Comment 4 Mike Krüger 2012-04-05 13:03:18 UTC
That's a bit unrelated to the original problem - for that we've an open mcs bug. That one really produces an awkward AST :(

*** This bug has been marked as a duplicate of bug 3578 ***