Bug 13551 - Resolve usings / fully qualify class with namespace is broken from alt-enter
Summary: Resolve usings / fully qualify class with namespace is broken from alt-enter
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: General ()
Version: 4.0.10
Hardware: PC Mac OS
: Normal normal
Target Milestone: master
Assignee: Mike Krüger
Depends on:
Reported: 2013-07-29 04:29 UTC by Urs Keller
Modified: 2014-03-28 13:05 UTC (History)
3 users (show)

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

bug in alt-enter vs. the correct behaviour in the context menu (90.95 KB, image/png)
2013-07-29 04:29 UTC, Urs Keller

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:

Description Urs Keller 2013-07-29 04:29:31 UTC
Created attachment 4467 [details]
bug in alt-enter vs. the correct behaviour in the context menu

I'm using 4.0.10 build 7, on the project in question Mono/.NET 4.5 is used

Steps to reproduce:
1. In a C# file instantiate an "unimported" class e.g.: new HttpRequestCachePolicy()
2. on the class name hit alt-enter
3. there are at least two proposition one is adding a using directive the other is to fully qualify the class

Expected behaviour:
-When choosing the "fully qualify option" the class should be qualified with the package and the file should compile

Actual behaviour:
-The class is qualified incorrectly instead of "new some.namespace.SomeClass()" "some.namespace.new SomeClass()" is generated. e.g. for "new HttpRequestCachePolicy()" "System.Net.Cache.new HttpRequestCachePolicy()" is generated.
Also c.f. attached screenshots.

When instead of using "alt-enter" I use the context menu (right click) and navigate to Resolve, the behaviour is correct.
Comment 1 Mike Krüger 2013-09-03 01:26:59 UTC
Comment 2 Ram Chandra 2014-03-28 13:05:37 UTC
I have checked this issue on master builds.

With the help of "bug description", I have instantiate the "HttpRequestCachePolicy()" class and press (Alt+Enter) on class name and select full qualified name. I observed that, the class is qualified correctly. 

Example :
          var obj = new System.Net.Cache.HttpRequestCachePolicy ();

screencast :http://www.screencast.com/t/tfMDoGeT

This issue is working fine. Hence closing this issue.

Environment Info:

Mac OS X 10.7.5
Xamarin Studio: 4.2.4 (build 266)

Build Information
Release ID: 402040266
Git revision: 57fa6b7639703775ae1d5c46536e42ab424cb177
Build date: 2014-03-20 12:34:27-04
Xamarin addins: eee141c29724a19529e77b8e743086d95b29f5ba