From c468a2a3df62a51f99402b5df970a92babc2795d Mon Sep 17 00:00:00 2001 From: "Gerrit \"Geaz\" Gazic" Date: Fri, 25 Sep 2015 16:57:46 +0200 Subject: [PATCH] MethodCall Parser --- CHANGELOG.txt | 5 +++++ .../SharpDox.Build.NRefactory/Loader/CSharpSolution.cs | 2 +- .../SharpDox.Build.NRefactory/Parser/MethodCallParser.cs | 7 +++++-- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 41c6bbaa..b17c7e50 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,3 +1,8 @@ +Version 1.0rc2 + +- GUI bugfixes +- Method call parser bugfix + Version 1.0rc - Created two seperate executes (gui and console) diff --git a/src/Libraries/SharpDox.Build.NRefactory/Loader/CSharpSolution.cs b/src/Libraries/SharpDox.Build.NRefactory/Loader/CSharpSolution.cs index befe46eb..66bd969c 100644 --- a/src/Libraries/SharpDox.Build.NRefactory/Loader/CSharpSolution.cs +++ b/src/Libraries/SharpDox.Build.NRefactory/Loader/CSharpSolution.cs @@ -53,7 +53,7 @@ public IEnumerable AllFiles public CSharpFile GetFile(string fileName) { - return AllFiles.First(f => f.FileName == fileName); + return AllFiles.FirstOrDefault(f => f.FileName == fileName); } private static bool FileIsSolution(string pathToSolutionFile) diff --git a/src/Libraries/SharpDox.Build.NRefactory/Parser/MethodCallParser.cs b/src/Libraries/SharpDox.Build.NRefactory/Parser/MethodCallParser.cs index 1a75ba9b..d72a0cd3 100644 --- a/src/Libraries/SharpDox.Build.NRefactory/Parser/MethodCallParser.cs +++ b/src/Libraries/SharpDox.Build.NRefactory/Parser/MethodCallParser.cs @@ -24,11 +24,14 @@ internal void ParseMethodCalls() { HandleOnItemParseStart(sdMethod.Name); var file = _solution.GetFile(sdType.Region.Filename); - var methodAstNode = file.SyntaxTree.GetNodeContaining( + if(file != null) // TODO Check why file can be null sometimes! + { + var methodAstNode = file.SyntaxTree.GetNodeContaining( new TextLocation(sdMethod.Region.BeginLine, sdMethod.Region.BeginColumn), new TextLocation(sdMethod.Region.EndLine, sdMethod.Region.EndColumn)); - methodAstNode.AcceptVisitor(new MethodVisitor(_repository, sdMethod, sdType, file)); + methodAstNode.AcceptVisitor(new MethodVisitor(_repository, sdMethod, sdType, file)); + } } } }