Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 'move type' with file scoped namespaces #55020

Merged

Conversation

CyrusNajmabadi
Copy link
Member

@CyrusNajmabadi CyrusNajmabadi commented Jul 21, 2021

Relates to test plan: #49000

@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner July 21, 2021 19:05
@dotnet dotnet deleted a comment from azure-pipelines bot Jul 21, 2021
@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@@ -320,6 +320,31 @@ class Class1 { }
await TestMoveTypeToNewFileAsync(code, codeAfterMove, expectedDocumentName, destinationDocumentText);
}

[WpfFact, Trait(Traits.Feature, Traits.Features.CodeActionsMoveType)]
public async Task MoveTypeWithWithFileScopedNamespace()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a tests for moving Class1 and Class2 with this setup? Assuming this is valid with filescoped namespaces

namespace N1;

class Class1 
{
    Nested.Class2 C2 { get; }
}

namespace Nested
{
    class Class2 { }
}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's not valid. it's illegal to mix/match a file-scoped namespace with any other sort of namespace (including another file scoped namespace).

@CyrusNajmabadi
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@CyrusNajmabadi
Copy link
Member Author

ping @ryzngard

@CyrusNajmabadi CyrusNajmabadi merged commit 91d692f into dotnet:main Jul 22, 2021
@ghost ghost added this to the Next milestone Jul 22, 2021
@CyrusNajmabadi CyrusNajmabadi deleted the fileScopedNamespaceMoveType branch July 22, 2021 18:56
@allisonchou allisonchou modified the milestones: Next, 17.0.P3 Jul 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants