Browse Source

Fixed SD2-650: Find References error with single file open

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@1029 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 20 years ago
parent
commit
889902cff7
  1. 39
      data/resources/layouts/Debug.xml
  2. 14
      data/resources/layouts/Default.xml
  3. 12
      data/resources/layouts/Plain.xml
  4. 25
      src/Main/Base/Project/Src/Dom/Implementations/SearchClassReturnType.cs
  5. 2
      src/Main/Base/Project/Src/Gui/Dialogs/NewFileDialog.cs
  6. 1
      src/Main/Base/Project/Src/Services/File/FileService.cs
  7. 5
      src/Main/Base/Project/Src/Services/RefactoringService/RefactoringService.cs

39
data/resources/layouts/Debug.xml

@ -1,8 +1,8 @@ @@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- DockPanel configuration file. Author: Weifen Luo, all rights reserved. -->
<!-- !!! AUTOMATICALLY GENERATED FILE. DO NOT MODIFY !!! -->
<DockPanel FormatVersion="0.9.3" DockLeftPortion="0.162210282258557" DockRightPortion="0.159760856281619" DockTopPortion="0.25" DockBottomPortion="0.271028728576449" ActiveDocumentPane="-1" ActivePane="1">
<Contents Count="25">
<DockPanel FormatVersion="0.9.3" DockLeftPortion="0.162210282258557" DockRightPortion="0.159760856281619" DockTopPortion="0.25" DockBottomPortion="0.271028728576449" ActiveDocumentPane="12" ActivePane="-1">
<Contents Count="28">
<Content ID="0" PersistString="ICSharpCode.MbUnitPad.MbUnitPadContent" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="1" PersistString="ICSharpCode.SharpDevelop.Project.ProjectBrowserPad" AutoHidePortion="0.25" IsHidden="False" IsFloat="False" />
<Content ID="2" PersistString="ICSharpCode.SharpDevelop.Gui.SideBarView" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
@ -28,15 +28,18 @@ @@ -28,15 +28,18 @@
<Content ID="22" PersistString="ICSharpCode.NAntAddIn.Gui.NAntPadContent" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="23" PersistString="HtmlHelp2.HtmlHelp2DynamicHelpPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="24" PersistString="SharpQuery.Pads.SharpQueryPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="25" PersistString="Boo.InterpreterAddIn.InterpreterPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="26" PersistString="SharpReportAddin.FieldsExplorer" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="27" PersistString="ICSharpCode.SharpDevelop.Gui.SdiWorkspaceWindow" AutoHidePortion="0.25" IsHidden="False" IsFloat="False" />
</Contents>
<Panes Count="12">
<Panes Count="13">
<Pane ID="0" DockState="Float" ActiveContent="-1">
<Contents Count="1">
<Content ID="0" RefID="0" />
</Contents>
</Pane>
<Pane ID="1" DockState="DockRight" ActiveContent="13">
<Contents Count="13">
<Contents Count="14">
<Content ID="0" RefID="0" />
<Content ID="1" RefID="9" />
<Content ID="2" RefID="13" />
@ -50,6 +53,7 @@ @@ -50,6 +53,7 @@
<Content ID="10" RefID="22" />
<Content ID="11" RefID="23" />
<Content ID="12" RefID="24" />
<Content ID="13" RefID="26" />
</Contents>
</Pane>
<Pane ID="2" DockState="Float" ActiveContent="-1">
@ -64,14 +68,15 @@ @@ -64,14 +68,15 @@
<Content ID="2" RefID="12" />
</Contents>
</Pane>
<Pane ID="4" DockState="DockBottom" ActiveContent="14">
<Contents Count="6">
<Content ID="0" RefID="4" />
<Content ID="1" RefID="7" />
<Pane ID="4" DockState="DockBottom" ActiveContent="4">
<Contents Count="7">
<Content ID="0" RefID="7" />
<Content ID="1" RefID="4" />
<Content ID="2" RefID="3" />
<Content ID="3" RefID="8" />
<Content ID="4" RefID="11" />
<Content ID="5" RefID="14" />
<Content ID="6" RefID="25" />
</Contents>
</Pane>
<Pane ID="5" DockState="Float" ActiveContent="-1">
@ -112,20 +117,30 @@ @@ -112,20 +117,30 @@
<Content ID="0" RefID="4" />
</Contents>
</Pane>
<Pane ID="12" DockState="Document" ActiveContent="27">
<Contents Count="1">
<Content ID="0" RefID="27" />
</Contents>
</Pane>
</Panes>
<DockWindows Count="3">
<DockWindow ID="0" DockState="DockLeft" ZOrderIndex="5">
<DockWindows Count="4">
<DockWindow ID="0" DockState="Document" ZOrderIndex="1">
<DockList Count="1">
<Pane ID="0" RefID="12" PrevPane="-1" Alignment="Right" Proportion="0.5" />
</DockList>
</DockWindow>
<DockWindow ID="1" DockState="DockLeft" ZOrderIndex="5">
<DockList Count="1">
<Pane ID="0" RefID="6" PrevPane="-1" Alignment="Bottom" Proportion="0.5" />
</DockList>
</DockWindow>
<DockWindow ID="1" DockState="DockRight" ZOrderIndex="7">
<DockWindow ID="2" DockState="DockRight" ZOrderIndex="7">
<DockList Count="2">
<Pane ID="0" RefID="1" PrevPane="-1" Alignment="Bottom" Proportion="0.5" />
<Pane ID="1" RefID="3" PrevPane="1" Alignment="Bottom" Proportion="0.574444444444444" />
</DockList>
</DockWindow>
<DockWindow ID="2" DockState="DockBottom" ZOrderIndex="6">
<DockWindow ID="3" DockState="DockBottom" ZOrderIndex="6">
<DockList Count="1">
<Pane ID="0" RefID="4" PrevPane="-1" Alignment="Left" Proportion="0.5" />
</DockList>

14
data/resources/layouts/Default.xml

@ -1,8 +1,8 @@ @@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- DockPanel configuration file. Author: Weifen Luo, all rights reserved. -->
<!-- !!! AUTOMATICALLY GENERATED FILE. DO NOT MODIFY !!! -->
<DockPanel FormatVersion="0.9.3" DockLeftPortion="0.176451264222485" DockRightPortion="0.178922617303663" DockTopPortion="0.25" DockBottomPortion="0.259014607431894" ActiveDocumentPane="-1" ActivePane="1">
<Contents Count="25">
<DockPanel FormatVersion="0.9.3" DockLeftPortion="0.176451264222485" DockRightPortion="0.178922617303663" DockTopPortion="0.25" DockBottomPortion="0.259014607431894" ActiveDocumentPane="-1" ActivePane="-1">
<Contents Count="27">
<Content ID="0" PersistString="ICSharpCode.MbUnitPad.MbUnitPadContent" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="1" PersistString="ICSharpCode.SharpDevelop.Project.ProjectBrowserPad" AutoHidePortion="0.25" IsHidden="False" IsFloat="False" />
<Content ID="2" PersistString="ICSharpCode.SharpDevelop.Gui.SideBarView" AutoHidePortion="0.25" IsHidden="False" IsFloat="False" />
@ -28,6 +28,8 @@ @@ -28,6 +28,8 @@
<Content ID="22" PersistString="ICSharpCode.NAntAddIn.Gui.NAntPadContent" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="23" PersistString="HtmlHelp2.HtmlHelp2DynamicHelpPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="24" PersistString="SharpQuery.Pads.SharpQueryPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="25" PersistString="Boo.InterpreterAddIn.InterpreterPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="26" PersistString="SharpReportAddin.FieldsExplorer" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
</Contents>
<Panes Count="13">
<Pane ID="0" DockState="Float" ActiveContent="-1">
@ -36,7 +38,7 @@ @@ -36,7 +38,7 @@
</Contents>
</Pane>
<Pane ID="1" DockState="DockRight" ActiveContent="-1">
<Contents Count="13">
<Contents Count="14">
<Content ID="0" RefID="0" />
<Content ID="1" RefID="22" />
<Content ID="2" RefID="23" />
@ -50,6 +52,7 @@ @@ -50,6 +52,7 @@
<Content ID="10" RefID="19" />
<Content ID="11" RefID="20" />
<Content ID="12" RefID="24" />
<Content ID="13" RefID="26" />
</Contents>
</Pane>
<Pane ID="2" DockState="Float" ActiveContent="-1">
@ -63,8 +66,8 @@ @@ -63,8 +66,8 @@
<Content ID="1" RefID="9" />
</Contents>
</Pane>
<Pane ID="4" DockState="DockBottom" ActiveContent="7">
<Contents Count="7">
<Pane ID="4" DockState="DockBottom" ActiveContent="4">
<Contents Count="8">
<Content ID="0" RefID="7" />
<Content ID="1" RefID="4" />
<Content ID="2" RefID="3" />
@ -72,6 +75,7 @@ @@ -72,6 +75,7 @@
<Content ID="4" RefID="8" />
<Content ID="5" RefID="21" />
<Content ID="6" RefID="15" />
<Content ID="7" RefID="25" />
</Contents>
</Pane>
<Pane ID="5" DockState="Float" ActiveContent="-1">

12
data/resources/layouts/Plain.xml

@ -1,8 +1,8 @@ @@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- DockPanel configuration file. Author: Weifen Luo, all rights reserved. -->
<!-- !!! AUTOMATICALLY GENERATED FILE. DO NOT MODIFY !!! -->
<DockPanel FormatVersion="0.9.3" DockLeftPortion="0.176451264222485" DockRightPortion="0.178922617303663" DockTopPortion="0.25" DockBottomPortion="0.259014607431894" ActiveDocumentPane="-1" ActivePane="-1">
<Contents Count="25">
<DockPanel FormatVersion="0.9.3" DockLeftPortion="0.176451264222485" DockRightPortion="0.178922617303663" DockTopPortion="0.25" DockBottomPortion="0.259014607431894" ActiveDocumentPane="-1" ActivePane="1">
<Contents Count="27">
<Content ID="0" PersistString="ICSharpCode.MbUnitPad.MbUnitPadContent" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="1" PersistString="ICSharpCode.SharpDevelop.Project.ProjectBrowserPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="2" PersistString="ICSharpCode.SharpDevelop.Gui.SideBarView" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
@ -28,6 +28,8 @@ @@ -28,6 +28,8 @@
<Content ID="22" PersistString="ICSharpCode.NAntAddIn.Gui.NAntPadContent" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="23" PersistString="HtmlHelp2.HtmlHelp2DynamicHelpPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="24" PersistString="SharpQuery.Pads.SharpQueryPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="25" PersistString="Boo.InterpreterAddIn.InterpreterPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="26" PersistString="SharpReportAddin.FieldsExplorer" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
</Contents>
<Panes Count="13">
<Pane ID="0" DockState="Float" ActiveContent="-1">
@ -36,7 +38,7 @@ @@ -36,7 +38,7 @@
</Contents>
</Pane>
<Pane ID="1" DockState="DockRight" ActiveContent="-1">
<Contents Count="13">
<Contents Count="14">
<Content ID="0" RefID="0" />
<Content ID="1" RefID="22" />
<Content ID="2" RefID="23" />
@ -50,6 +52,7 @@ @@ -50,6 +52,7 @@
<Content ID="10" RefID="19" />
<Content ID="11" RefID="20" />
<Content ID="12" RefID="24" />
<Content ID="13" RefID="26" />
</Contents>
</Pane>
<Pane ID="2" DockState="Float" ActiveContent="-1">
@ -64,7 +67,7 @@ @@ -64,7 +67,7 @@
</Contents>
</Pane>
<Pane ID="4" DockState="DockBottom" ActiveContent="-1">
<Contents Count="7">
<Contents Count="8">
<Content ID="0" RefID="7" />
<Content ID="1" RefID="4" />
<Content ID="2" RefID="3" />
@ -72,6 +75,7 @@ @@ -72,6 +75,7 @@
<Content ID="4" RefID="8" />
<Content ID="5" RefID="21" />
<Content ID="6" RefID="15" />
<Content ID="7" RefID="25" />
</Contents>
</Pane>
<Pane ID="5" DockState="Float" ActiveContent="-1">

25
src/Main/Base/Project/Src/Dom/Implementations/SearchClassReturnType.cs

@ -51,19 +51,22 @@ namespace ICSharpCode.SharpDevelop.Dom @@ -51,19 +51,22 @@ namespace ICSharpCode.SharpDevelop.Dom
public override bool Equals(object o)
{
SearchClassReturnType rt = o as SearchClassReturnType;
if (rt == null) {
IReturnType rt2 = o as IReturnType;
if (rt2 != null && rt2.IsDefaultReturnType)
return rt2.FullyQualifiedName == this.FullyQualifiedName && rt2.TypeParameterCount == this.TypeParameterCount;
else
if (rt != null) {
if (name != rt.name)
return false;
if (declaringClass.FullyQualifiedName == rt.declaringClass.FullyQualifiedName
&& typeParameterCount == rt.typeParameterCount
&& caretLine == rt.caretLine
&& caretColumn == rt.caretColumn)
{
return true;
}
}
if (declaringClass.FullyQualifiedName != rt.declaringClass.FullyQualifiedName) return false;
if (typeParameterCount != rt.typeParameterCount) return false;
if (caretLine != rt.caretLine) return false;
if (caretColumn != rt.caretColumn) return false;
if (typeParameterCount != rt.typeParameterCount) return false;
return name == rt.name;
IReturnType rt2 = o as IReturnType;
if (rt2 != null && rt2.IsDefaultReturnType)
return rt2.FullyQualifiedName == this.FullyQualifiedName && rt2.TypeParameterCount == this.TypeParameterCount;
else
return false;
}
public override int GetHashCode()

2
src/Main/Base/Project/Src/Gui/Dialogs/NewFileDialog.cs

@ -370,6 +370,8 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -370,6 +370,8 @@ namespace ICSharpCode.SharpDevelop.Gui
public void SaveFile(FileDescriptionTemplate newfile, string content)
{
string parsedFileName = StringParser.Parse(newfile.Name);
if (parsedFileName.StartsWith("/") || parsedFileName.StartsWith("\\"))
parsedFileName = parsedFileName.Substring(1);
if (newfile.IsDependentFile && Path.IsPathRooted(parsedFileName)) {
File.WriteAllText(parsedFileName, StringParser.Parse(content), ParserService.DefaultFileEncoding);
} else {

1
src/Main/Base/Project/Src/Services/File/FileService.cs

@ -107,7 +107,6 @@ namespace ICSharpCode.Core @@ -107,7 +107,6 @@ namespace ICSharpCode.Core
return null;
}
newContent.UntitledName = defaultName;
newContent.IsDirty = false;
DisplayBindingService.AttachSubWindows(newContent, false);
WorkbenchSingleton.Workbench.ShowView(newContent);

5
src/Main/Base/Project/Src/Services/RefactoringService/RefactoringService.cs

@ -303,6 +303,8 @@ namespace ICSharpCode.SharpDevelop.Refactoring @@ -303,6 +303,8 @@ namespace ICSharpCode.SharpDevelop.Refactoring
static ProjectItem FindItem(string fileName)
{
if (ProjectService.OpenSolution == null)
return null;
foreach (IProject p in ProjectService.OpenSolution.Projects) {
foreach (ProjectItem item in p.Items) {
if (FileUtility.IsEqualFileName(fileName, item.FileName)) {
@ -315,6 +317,9 @@ namespace ICSharpCode.SharpDevelop.Refactoring @@ -315,6 +317,9 @@ namespace ICSharpCode.SharpDevelop.Refactoring
static void GetPossibleFilesInternal(List<ProjectItem> resultList, IProjectContent ownerProjectContent, bool internalOnly)
{
if (ProjectService.OpenSolution == null) {
return;
}
foreach (IProject p in ProjectService.OpenSolution.Projects) {
IProjectContent pc = ParserService.GetProjectContent(p);
if (pc == null) continue;

Loading…
Cancel
Save