Browse Source

fixed unreachable code and added a documentation comment to the Clear()-method.

pull/14/head
Siegfried Pammer 15 years ago
parent
commit
3dc2b5b105
  1. 10
      src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlParser.cs
  2. 4
      src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Xml/AXmlParser.cs

10
src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlParser.cs

@ -91,8 +91,8 @@ namespace ICSharpCode.XamlBinding
public ICompilationUnit Parse(IProjectContent projectContent, string fileName, ITextBuffer fileContent) public ICompilationUnit Parse(IProjectContent projectContent, string fileName, ITextBuffer fileContent)
{ {
//using (new DebugTimerObject("background parser")) { ICompilationUnit compilationUnit;
// Core.LoggingService.Info("file: " + fileName);
using (ParseAndLock(fileContent)) { using (ParseAndLock(fileContent)) {
var document = parser.LastDocument; var document = parser.LastDocument;
@ -101,9 +101,9 @@ namespace ICSharpCode.XamlBinding
document.AcceptVisitor(visitor); document.AcceptVisitor(visitor);
return visitor.CompilationUnit; compilationUnit = visitor.CompilationUnit;
} }
//}
// During project load all XAML files are parsed // During project load all XAML files are parsed
// most of them are not opened, thus fileContent.Version is null. // most of them are not opened, thus fileContent.Version is null.
// We can clear the parser data, because the file will be reparsed // We can clear the parser data, because the file will be reparsed
@ -119,6 +119,8 @@ namespace ICSharpCode.XamlBinding
} }
parser.Lock.ExitWriteLock(); parser.Lock.ExitWriteLock();
} }
return compilationUnit;
} }
/// <summary> /// <summary>

4
src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Xml/AXmlParser.cs

@ -175,6 +175,10 @@ namespace ICSharpCode.AvalonEdit.Xml
} }
} }
/// <summary>
/// Clears the parser data.
/// </summary>
/// <exception cref="InvalidOperationException">No write lock is held by the current thread.</exception>
public void Clear() public void Clear()
{ {
if (!Lock.IsWriteLockHeld) if (!Lock.IsWriteLockHeld)

Loading…
Cancel
Save