File tree Expand file tree Collapse file tree 1 file changed +3
-13
lines changed
src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/ProjectSystem Expand file tree Collapse file tree 1 file changed +3
-13
lines changed Original file line number Diff line number Diff line change @@ -200,19 +200,9 @@ await _projectManager
200200
201201 private void AddDocumentToMiscProjectCore ( ProjectSnapshotManager . Updater updater , string filePath , SourceText ? sourceText = null )
202202 {
203- _logger . LogDebug ( $ "Asked to add { filePath } to the miscellaneous files project, because we don't have project info (yet?)") ;
204-
205- #if DEBUG
206- // Note: This shouldn't happen because every caller checks to see if the document is already in a project
207- // before attempting to add it. This is just a sanity check.
208-
209- if ( _projectManager . TryFindContainingProject ( filePath , out var projectKey ) )
210- {
211- // Already in a known project, so we don't want it in the misc files project
212- _logger . LogDebug ( $ "File { filePath } is already in { projectKey } , so we're not adding it to the miscellaneous files project") ;
213- return ;
214- }
215- #endif
203+ Debug . Assert (
204+ ! _projectManager . TryFindContainingProject ( filePath , out _ ) ,
205+ $ "File already belongs to a project and can't be added to the misc files project") ;
216206
217207 _logger . LogInformation ( $ "Adding document '{ filePath } ' to miscellaneous files project.") ;
218208
You can’t perform that action at this time.
0 commit comments