Browse Source

Fixed SD2-1012: "Find references" throws exception when used in a stand alone file.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@1737 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 19 years ago
parent
commit
7bdc43c9c4
  1. 8
      src/Main/Base/Project/Src/Services/ProjectService/ParseableFileContentEnumerator.cs
  2. 11
      src/Main/Base/Project/Src/Services/RefactoringService/RefactoringService.cs
  3. 4
      src/Main/StartUp/Project/app.template.config

8
src/Main/Base/Project/Src/Services/ProjectService/ParseableFileContentEnumerator.cs

@ -81,9 +81,11 @@ namespace ICSharpCode.SharpDevelop.Project @@ -81,9 +81,11 @@ namespace ICSharpCode.SharpDevelop.Project
{
// Loading the source files is done asynchronously:
// While one file is parsed, the next is already loaded from disk.
string res = project.GetParseableFileContent(fileName);
if (res != null)
return res;
if (project != null) {
string res = project.GetParseableFileContent(fileName);
if (res != null)
return res;
}
// load file
Encoding tmp = defaultEncoding;

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

@ -334,9 +334,14 @@ namespace ICSharpCode.SharpDevelop.Refactoring @@ -334,9 +334,14 @@ namespace ICSharpCode.SharpDevelop.Refactoring
{
List<ProjectItem> resultList = new List<ProjectItem>();
if (ProjectService.OpenSolution == null) {
FileProjectItem tempItem = new FileProjectItem(null, ItemType.Compile);
tempItem.Include = ownerClass.CompilationUnit.FileName;
resultList.Add(tempItem);
foreach (IViewContent vc in WorkbenchSingleton.Workbench.ViewContentCollection) {
string name = vc.FileName ?? vc.UntitledName;
if (ParserService.GetParser(name) != null) {
FileProjectItem tempItem = new FileProjectItem(null, ItemType.Compile);
tempItem.Include = name;
resultList.Add(tempItem);
}
}
return resultList;
}

4
src/Main/StartUp/Project/app.template.config

@ -20,6 +20,10 @@ @@ -20,6 +20,10 @@
<assemblyIdentity name="ICSharpCode.SharpDevelop" publicKeyToken="f829da5c02be14ee" culture="neutral"/>
<bindingRedirect oldVersion="2.1.0.1661-$INSERTVERSION$" newVersion="$INSERTVERSION$"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="ICSharpCode.SharpDevelop.Dom" publicKeyToken="f829da5c02be14ee" culture="neutral"/>
<bindingRedirect oldVersion="2.1.0.1661-$INSERTVERSION$" newVersion="$INSERTVERSION$"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="ICSharpCode.TextEditor" publicKeyToken="4d61825e8dd49f1a" culture="neutral"/>
<bindingRedirect oldVersion="2.1.0.1661-$INSERTVERSION$" newVersion="$INSERTVERSION$"/>

Loading…
Cancel
Save