Bug 39392 - Fix->Generate Property is broken
Summary: Fix->Generate Property is broken
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: C# Binding ()
Version: unspecified
Hardware: PC Mac OS
: Highest normal
Target Milestone: (C7)
Assignee: Mike Krüger
Depends on:
Reported: 2016-03-06 09:33 UTC by David Karlaš
Modified: 2016-03-07 09:47 UTC (History)
1 user (show)

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:

Description David Karlaš 2016-03-06 09:33:25 UTC
1st problem: If I try to generate property on some class that is in different file exception is throw here: https://github.com/mono/monodevelop/blob/fc0b3cb/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateVariable/AbstractGenerateVariableService.cs#L231
This can be fixed by changing _document in https://github.com/mono/monodevelop/blob/fc0b3cb/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateVariable/AbstractGenerateVariableService.cs#L205 to _document.Project.Solution.GetDocument (result.Id).

Notice there is same method also in https://github.com/mono/monodevelop/blob/fc0b3cb/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateParameterizedMember/AbstractGenerateParameterizedMemberService.cs#L261

2nd problem: Insertion for property is offering insertions between usings, inside methods code... instead only between class members.

3rd after inserting member somewhere in class it inserts weirdly inside member declaration(this will be probably be fixed by 2nd problem fix).
Comment 1 xamarin-release-manager 2016-03-07 09:46:50 UTC
Fixed in version (master)

Author: Mike Kr??ger
Commit: ae05cdecb2b472ff5d45769e23adba3b2bff0301 (mono/monodevelop)
Comment 2 xamarin-release-manager 2016-03-07 09:47:14 UTC
Fixed in version (cycle7)

Author: Mike Kr??ger
Commit: 5e7336e8b9fa610b7458b3fd8d68c4609ce82bc1 (mono/monodevelop)