Bug 4528 - Foreach -> For refactoring eats empty lines
Summary: Foreach -> For refactoring eats empty lines
Status: RESOLVED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: C# Binding ()
Version: Trunk
Hardware: PC Linux
: Lowest enhancement
Target Milestone: (C7)
Assignee: Mike Krüger
URL:
Depends on:
Blocks:
 
Reported: 2012-04-19 13:43 UTC by Marek Safar
Modified: 2015-05-18 00:55 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 Marek Safar 2012-04-19 13:43:23 UTC

    
Comment 1 Mike Krüger 2012-04-19 14:57:18 UTC
give me an ast containing new lines
Comment 2 Marek Safar 2012-04-20 03:35:04 UTC
What, you need a token for LF in ast? Why when you have location for all visible tokens.
Comment 3 Mike Krüger 2012-04-20 05:59:02 UTC
when generating == replacing an AST - y I need the LF in the ast. The API is:

for = new for
for.block = foreach.block
for.block.Add (stuff)
replace (foreach, for)


That's the abstraction level in which refactorings should (and will be) built - therefore LF are needed (comments/pre processor directives are already in). I'll look what the GSoC student comes up with.

The whitespaces are not really required (but would be handy) - LF however are very useful in the ast. (like comments/directives)
Comment 4 Mike Krüger 2015-05-18 00:55:15 UTC
The roslyn parser finally fixed that