| 
						
						
							
								
							
						
						
					 | 
					 | 
					@ -214,8 +214,9 @@ namespace ICSharpCode.SharpDevelop.Parser | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
										return new ProjectEntry(parentProject, parseInfo.UnresolvedFile, parseInfo); | 
					 | 
					 | 
					 | 
										return new ProjectEntry(parentProject, parseInfo.UnresolvedFile, parseInfo); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									} else { | 
					 | 
					 | 
					 | 
									} else { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
										if (versionComparison == 0 && index >= 0) { | 
					 | 
					 | 
					 | 
										if (versionComparison == 0 && index >= 0) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
											// Ensure we have parse info for the specified project (entry.UnresolvedFile is null for newly registered projects)
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
											// If full parse info is requested, ensure we have full parse info.
 | 
					 | 
					 | 
					 | 
											// If full parse info is requested, ensure we have full parse info.
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
											if (!(fullParseInformationRequested && entries[index].CachedParseInformation == null)) { | 
					 | 
					 | 
					 | 
											if (entries[index].UnresolvedFile != null && !(fullParseInformationRequested && entries[index].CachedParseInformation == null)) { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
												// We already have the requested version parsed, just return it:
 | 
					 | 
					 | 
					 | 
												// We already have the requested version parsed, just return it:
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
												return entries[index]; | 
					 | 
					 | 
					 | 
												return entries[index]; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
											} | 
					 | 
					 | 
					 | 
											} | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -271,6 +272,7 @@ namespace ICSharpCode.SharpDevelop.Parser | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							#region ParseAsync
 | 
					 | 
					 | 
					 | 
							#region ParseAsync
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							Task<ProjectEntry> runningAsyncParseTask; | 
					 | 
					 | 
					 | 
							Task<ProjectEntry> runningAsyncParseTask; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							ITextSourceVersion runningAsyncParseFileContentVersion; | 
					 | 
					 | 
					 | 
							ITextSourceVersion runningAsyncParseFileContentVersion; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							IProject runningAsyncParseProject; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							bool runningAsyncParseFullInfoRequested; | 
					 | 
					 | 
					 | 
							bool runningAsyncParseFullInfoRequested; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							 | 
					 | 
					 | 
					 | 
							 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							public async Task<ParseInformation> ParseAsync(ITextSource fileContent, IProject parentProject, CancellationToken cancellationToken) | 
					 | 
					 | 
					 | 
							public async Task<ParseInformation> ParseAsync(ITextSource fileContent, IProject parentProject, CancellationToken cancellationToken) | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -312,8 +314,9 @@ namespace ICSharpCode.SharpDevelop.Parser | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
										int index = FindIndexForProject(parentProject); | 
					 | 
					 | 
					 | 
										int index = FindIndexForProject(parentProject); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
										int versionComparison = CompareVersions(fileContent.Version); | 
					 | 
					 | 
					 | 
										int versionComparison = CompareVersions(fileContent.Version); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
										if (versionComparison == 0 && index >= 0) { | 
					 | 
					 | 
					 | 
										if (versionComparison == 0 && index >= 0) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
											// Ensure we have parse info for the specified project (entry.UnresolvedFile is null for newly registered projects)
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
											// If full parse info is requested, ensure we have full parse info.
 | 
					 | 
					 | 
					 | 
											// If full parse info is requested, ensure we have full parse info.
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
											if (!(requestFullParseInformation && entries[index].CachedParseInformation == null)) { | 
					 | 
					 | 
					 | 
											if (entries[index].UnresolvedFile != null && !(requestFullParseInformation && entries[index].CachedParseInformation == null)) { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
												// We already have the requested version parsed, just return it:
 | 
					 | 
					 | 
					 | 
												// We already have the requested version parsed, just return it:
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
												return Task.FromResult(entries[index]); | 
					 | 
					 | 
					 | 
												return Task.FromResult(entries[index]); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
											} | 
					 | 
					 | 
					 | 
											} | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -321,6 +324,7 @@ namespace ICSharpCode.SharpDevelop.Parser | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
										// Optimization:
 | 
					 | 
					 | 
					 | 
										// Optimization:
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
										// if an equivalent task is already running, return that one instead
 | 
					 | 
					 | 
					 | 
										// if an equivalent task is already running, return that one instead
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
										if (runningAsyncParseTask != null && (!requestFullParseInformation || runningAsyncParseFullInfoRequested) | 
					 | 
					 | 
					 | 
										if (runningAsyncParseTask != null && (!requestFullParseInformation || runningAsyncParseFullInfoRequested) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
										    && runningAsyncParseProject == parentProject | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
										    && runningAsyncParseFileContentVersion.BelongsToSameDocumentAs(fileContent.Version) | 
					 | 
					 | 
					 | 
										    && runningAsyncParseFileContentVersion.BelongsToSameDocumentAs(fileContent.Version) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
										    && runningAsyncParseFileContentVersion.CompareAge(fileContent.Version) == 0) | 
					 | 
					 | 
					 | 
										    && runningAsyncParseFileContentVersion.CompareAge(fileContent.Version) == 0) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
										{ | 
					 | 
					 | 
					 | 
										{ | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -338,12 +342,14 @@ namespace ICSharpCode.SharpDevelop.Parser | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
												lock (this) { | 
					 | 
					 | 
					 | 
												lock (this) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
													runningAsyncParseTask = null; | 
					 | 
					 | 
					 | 
													runningAsyncParseTask = null; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
													runningAsyncParseFileContentVersion = null; | 
					 | 
					 | 
					 | 
													runningAsyncParseFileContentVersion = null; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
													runningAsyncParseProject = null; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
												} | 
					 | 
					 | 
					 | 
												} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
											} | 
					 | 
					 | 
					 | 
											} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
										}, cancellationToken); | 
					 | 
					 | 
					 | 
										}, cancellationToken); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									if (fileContent != null && fileContent.Version != null && !cancellationToken.CanBeCanceled) { | 
					 | 
					 | 
					 | 
									if (fileContent != null && fileContent.Version != null && !cancellationToken.CanBeCanceled) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
										runningAsyncParseTask = task; | 
					 | 
					 | 
					 | 
										runningAsyncParseTask = task; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
										runningAsyncParseFileContentVersion = fileContent.Version; | 
					 | 
					 | 
					 | 
										runningAsyncParseFileContentVersion = fileContent.Version; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
										runningAsyncParseProject = parentProject; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
										runningAsyncParseFullInfoRequested = requestFullParseInformation; | 
					 | 
					 | 
					 | 
										runningAsyncParseFullInfoRequested = requestFullParseInformation; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									} | 
					 | 
					 | 
					 | 
									} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								} | 
					 | 
					 | 
					 | 
								} | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					 | 
					
  |