File-based apps: Implement csproj-in-cone heuristic for FBA detection
- Dominant language
- C#
- Stars
- 20.7k
- Forks
- 4.3k
- PR merge metrics
- PR metrics pending
Description
### Docs change
- [x] Migrate & review agreed upon classification logic from [CDK doc](https://devdiv.visualstudio.com/DevDiv/_git/vs-green?path=/docs/hard-problems/file-based-app-detection.md&version=GBmain&_a=preview&anchor=proposed-future-classification-logic) to [Roslyn doc](https://github.com/dotnet/roslyn/blob/main/docs/features/file-based-programs-vscode.md).
- CDK doc must be updated to link to the Roslyn doc when we do this
### Implementation
Implement the proposed classification logic from the above linked docs.
We have tech debt to address, when it comes to migrating loose files between workspaces, when edits are made such as inserting/deleting `#:`, top-level statements, etc. See `FileBasedProgramsProjectSystem.IsMiscellaneousFilesDocumentAsync`:
https://github.com/dotnet/roslyn/blob/88f82dd80a684ba50029859cbef61756bf2fc86b/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/FileBasedPrograms/FileBasedProgramsProjectSystem.cs#L132-L140
The csproj-in-cone check is a significant update to this transition logic. We should figure out how to refactor this transition logic to work in a more "healthy" way, e.g. basing things on properly listening for the kinds of edits we care about, issuing notifications to the right components to invalidate the right things, etc., instead of just performing a possibly expensive check whenever a request comes in for a loose file.
Contributor guide
Assessment
This issue has not been assessed yet.