Bug 2093 - Saving copied source file with no source errors
Summary: Saving copied source file with no source errors
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: C# Binding ()
Version: 2.8.2
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Mike Krüger
Depends on:
Reported: 2011-11-18 16:57 UTC by Ian
Modified: 2011-11-24 09:31 UTC (History)
2 users (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 Ian 2011-11-18 16:57:05 UTC
MT 2.5, MD 2.8

This might be a MD, not MT. Not sure issue.

When I copy a source file into the same folder it becomes My File (copy).cs

Then I comment out all the code and try to save. This error pops up:

System.InvalidOperationException: The source sequence is empty
  at System.Linq.Enumerable.First[Statement] (IEnumerable`1 source) [0x00000] in <filename unknown>:0 
  at MonoDevelop.CSharp.HelperMethods.ParseSnippet (ICSharpCode.NRefactory.CSharp.CSharpParser parser, Mono.TextEditor.TextEditorData data) [0x00064] in /private/tmp/source/monodevelop/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Resolver/HelperMethods.cs:87 
  at MonoDevelop.CSharp.Formatting.CSharpFormatter.OnTheFlyFormat (MonoDevelop.Projects.Policies.PolicyContainer policyParent, IEnumerable`1 mimeTypeChain, Mono.TextEditor.TextEditorData data, Int32 startOffset, Int32 endOffset) [0x0001c] in /private/tmp/source/monodevelop/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpFormatter.cs:132 
  at MonoDevelop.Ide.CodeFormatting.CodeFormatter.OnTheFlyFormat (MonoDevelop.Projects.Policies.PolicyContainer policyParent, Mono.TextEditor.TextEditorData data, Int32 startOffset, Int32 endOffset) [0x00028] in /private/tmp/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeFormatting/CodeFormatter.cs:113 
  at MonoDevelop.SourceEditor.SourceEditorView.Save (System.String fileName, System.String encoding) [0x0011f] in /private/tmp/source/monodevelop/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorView.cs:391 
  at MonoDevelop.SourceEditor.SourceEditorView.Save (System.String fileName) [0x00000] in /private/tmp/source/monodevelop/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorView.cs:359 
  at MonoDevelop.Ide.Gui.Workbench.OnWindowClosing (System.Object sender, MonoDevelop.Ide.Gui.WorkbenchWindowEventArgs args) [0x00111] in /private/tmp/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs:613
Comment 1 Mike Krüger 2011-11-24 09:31:10 UTC
Fixed in master.