Browse Source

Avoid re-using cached parse information when parsing the project after a debug/release switch.

newNRvisualizers
Daniel Grunwald 14 years ago
parent
commit
789a8f5fdc
  1. 4
      src/Main/Base/Project/Src/Services/ParserService/IParserService.cs
  2. 3
      src/Main/Base/Project/Src/Services/ParserService/ParseProjectContent.cs
  3. 2
      src/Main/SharpDevelop/Parser/ParserServiceEntry.cs

4
src/Main/Base/Project/Src/Services/ParserService/IParserService.cs

@ -242,8 +242,10 @@ namespace ICSharpCode.SharpDevelop.Parser @@ -242,8 +242,10 @@ namespace ICSharpCode.SharpDevelop.Parser
bool HasParser(FileName fileName);
/// <summary>
/// Clears the cached parse information.
/// Clears the cached parse information for the specified file.
/// If the file does not belong to any project, this also clears the cached type system.
/// If the file belongs to a project, the cached type system is kept (so that the classes don't go missing from the project),
/// but the next ParseFile() call will cause it to be reparsed even if it is unchanged.
/// </summary>
void ClearParseInformation(FileName fileName);

3
src/Main/Base/Project/Src/Services/ParserService/ParseProjectContent.cs

@ -358,6 +358,9 @@ namespace ICSharpCode.SharpDevelop.Parser @@ -358,6 +358,9 @@ namespace ICSharpCode.SharpDevelop.Parser
CancellationToken = progressMonitor.CancellationToken
},
fileName => {
// Clear cached parse information so that the file is forced to be reparsed even if it is unchanged
parserService.ClearParseInformation(fileName);
ITextSource content = finder.Create(fileName);
if (content != null) {
parserService.ParseFile(fileName, content, project);

2
src/Main/SharpDevelop/Parser/ParserServiceEntry.cs

@ -119,6 +119,8 @@ namespace ICSharpCode.SharpDevelop.Parser @@ -119,6 +119,8 @@ namespace ICSharpCode.SharpDevelop.Parser
entries[i] = new ProjectEntry(oldEntry.Project, oldEntry.UnresolvedFile, null);
}
}
// force re-parse on next ParseFile() call even if unchanged
this.currentVersion = null;
}
}

Loading…
Cancel
Save