Bug 20234 - Expand Selection command selects whole conditional blocks instead of expressions
Summary: Expand Selection command selects whole conditional blocks instead of expressions
Status: RESOLVED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Text Editor ()
Version: 5.0
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: master
Assignee: Mike Krüger
URL:
Depends on:
Blocks:
 
Reported: 2014-05-31 02:47 UTC by Frank A. Krueger
Modified: 2014-06-02 01:25 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 FIXED

Description Frank A. Krueger 2014-05-31 02:47:22 UTC
When you have conditional code such as:

	#if __ANDROID__

	#elif __IOS__
	public override void Draw (System.Drawing.RectangleF rect)
	{
		base.Dr|aw (rect);
		var dirtyRect = new Rectangle (rect.X, rect.Y, rect.Width, rect.Height);
	}
	#endif

With cursor in the Draw() base call, the "Expand selection" command no longer expands on expressions but instead selects the whole conditional body.

This makes editing code in conditional compilation harder especially with trained muscle memory to invoke "expand selection".
Comment 1 Mike Krüger 2014-05-31 04:11:58 UTC
__IOS__ must be defined for this command to work - this command works on the AST. And if it is not defined the body is no source code any longer.
Comment 2 Frank A. Krueger 2014-05-31 14:17:00 UTC
Mike, I know that it won't work in a block that's not active. Give me a little credit.

I made you a video to show it failing.

http://screencast.com/t/rfhkUjJL

Please watch the video.

It's a video of the bug in action.
Comment 3 Mike Krüger 2014-05-31 16:39:40 UTC
Hm, interesting in my quick example I made from code above it worked as expected:/.

I'll figue it out ... the screencast shows that there is a problem.
Comment 4 Mike Krüger 2014-06-02 01:25:31 UTC
My test case used #define __IOS__ at the top of the file - there it worked :/.
The expand/shrink selection commands were one of my first proof of concept features that showed how great the new AST is ... I should've reworked that later on.

But now it's fixed.

Thanks