-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Labels
Area-CompilersDev17 IDE PriorityFeature RequestTestTest failures in roslyn-CITest failures in roslyn-CI
Milestone
Description
Championed feature: dotnet/csharplang#137
Speclet at: https://github.com/dotnet/csharplang/blob/main/proposals/csharp-10.0/file-scoped-namespaces.md
(checklist currently references changes in #54669)
Compiler
- LangVer (see
NamespaceWithSemicolon_CSharp9) - Multiple file-scoped declarations (see
MultipleSingleLineNamespaces) - Mix and match declarations (see
MultipleFileScopedNamespaces) -
GetDeclaredSymbolin mix&match scenarios (seeTestGetDeclaredSymbolFromNestedNamespace) - File-scoped declaration after type (see
NamespaceWithPrecedingType) - test with top-level statement (see
FileScopedNamespaceWithPrecedingStatement) - lookup rules,
LookupSymbols(binder chain) (seeSemanticModelAPITests.LookupInNamespace) - double-check all
NamespaceDeclarationSyntaxandSyntaxKind.NamespaceDeclarationreferences have been adjusted after merge frommainbranch- note: this was done in the compiler but many places outside the compiler might still need to be changed. See Test plan for "file-scoped namespace declarations" #49000 (comment)
- PROTOTYPE markers
- EnC (manual validation)
- smoke build of VS
- can debug and set breakpoints (manual validation)
- public API review
- SyntaxNormalizer (see
SyntaxNormalizerTests.TestFileScopedNamespace)
Productivity
- Formatting
- Currently, changing a "regular" namespace declaration to file-scoped doesn't automatically unindent the subsequent members. I do not know if this should change or not.
- Indentation
- Classification
- Completion
- FAR (manual validation)
- NavBar (manual validation)
- Convert to file-scoped namespace + code style preference
- Remove unused usings
- Currently doesn't work following a file-scoped namespace
- Move type to new file
- Currently this doesn't work at all in the presence of a file-scoped namespace (even for members that precede the namespace)
- Region collapsing (seems fine as-is)
- Currently, we can't collapse the file scoped namespace's members into the namespace
- LocationInfo currently doesn't work properly. See the following test:
[Fact, Trait(Traits.Feature, Traits.Features.DebuggingLocationName)] [WorkItem(49000, "https://github.com/dotnet/roslyn/issues/49000")] public async Task TestFileScopedNamespace() { // This test behavior is incorrect. This should be Namespace.Class.Method. // See the associated WorkItem for details. await TestAsync( @"namespace Namespace; class Class { void Method() { }$$ } ", "Class.Method()", 2); } - This doesn't seem to impact debugging, navbar, etc. It's not clear to me (@RikkiGibson) what pain is introduced if we merge before fixing this.
Metadata
Metadata
Labels
Area-CompilersDev17 IDE PriorityFeature RequestTestTest failures in roslyn-CITest failures in roslyn-CI