-
Notifications
You must be signed in to change notification settings - Fork 199
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Don't add already known documents to the misc files project #10753
Conversation
var potentialProjects = _projectManager.FindPotentialProjects(textDocumentPath); | ||
foreach (var project in potentialProjects) | ||
{ | ||
if (project.DocumentFilePaths.Contains(textDocumentPath, FilePathComparer.Instance)) | ||
{ | ||
// Already in a known project, so we don't want it in the misc files project | ||
_logger.LogDebug($"File {textDocumentPath} is already in {project.Key} so we're not adding it to the miscellaneous files project"); | ||
return; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this basically the same as the below?
var potentialProjects = _projectManager.FindPotentialProjects(textDocumentPath); | |
foreach (var project in potentialProjects) | |
{ | |
if (project.DocumentFilePaths.Contains(textDocumentPath, FilePathComparer.Instance)) | |
{ | |
// Already in a known project, so we don't want it in the misc files project | |
_logger.LogDebug($"File {textDocumentPath} is already in {project.Key} so we're not adding it to the miscellaneous files project"); | |
return; | |
} | |
} | |
if (_projectManager.TryResolveDocumentInAnyProject(textDocumentPath, _logger, out var project) | |
{ | |
// Already in a known project, so we don't want it in the misc files project | |
_logger.LogDebug($"File {textDocumentPath} is already in {project.Key} so we're not adding it to the miscellaneous files project"); | |
return; | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol, it very well could be. That's a little embarassing :D
This isn't quite correct. We don't share a project manager across VS and the LSP server, but we do share project information. |
Noticed in the logs that we were double-compiling files, and it was causing issues in my "self versioned documents" branch. Separated out of that to make it easier to review.
RCA is because we now share a project manager across VS and LSP server, so we get real project information much sooner than before, which beats file watchers etc.