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

Expose MoveToNamespace action in code fixes #68853

Open
SamPruden opened this issue Jul 2, 2023 · 0 comments
Open

Expose MoveToNamespace action in code fixes #68853

SamPruden opened this issue Jul 2, 2023 · 0 comments
Assignees
Labels
Area-IDE Concept-API This issue involves adding, removing, clarification, or modification of an API. Feature Request
Milestone

Comments

@SamPruden
Copy link

Background and Motivation

I would like to write an analyzer and codefix to enforce a specific namespace/directory relationship that's a little different from the standard, motivated by the Unity game engine. I would like the codefix to be able to do the equivalent of MoveToNamespace when changing namespaces, but as far as I can tell that functionality isn't exposed.

I tried looking at the MatchFolderAndNamespace codefix for tips, but it looks like that moves the file to match the namespace, which is the opposite of what I want.

It might be possible to chase symbol references throughout the solution and to manually patch them to a changed namespace, but this seems very brittle to problems such as ambiguities introduced by adding new usings to other files. Presumably the infrastructure for doing this well already exists and could be exposed.

Proposed API

I would expect an API similar to Renamer for refactoring namespaces.

@SamPruden SamPruden added Concept-API This issue involves adding, removing, clarification, or modification of an API. Feature Request labels Jul 2, 2023
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Jul 2, 2023
@arkalyanms arkalyanms removed the untriaged Issues and PRs which have not yet been triaged by a lead label Aug 3, 2023
@arkalyanms arkalyanms added this to the Backlog milestone Aug 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE Concept-API This issue involves adding, removing, clarification, or modification of an API. Feature Request
Projects
None yet
Development

No branches or pull requests

3 participants