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

Do not offer 'convert' namespace when the ns has sibling types #74216

Merged
merged 5 commits into from
Jul 1, 2024

Conversation

CyrusNajmabadi
Copy link
Member

Fixes #74214

@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner June 29, 2024 16:42
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Jun 29, 2024
{
}
";
var code = """
Copy link
Member Author

Choose a reason for hiding this comment

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

just converting to raw srtings.

@@ -61,6 +62,9 @@ public Test()
/// <inheritdoc cref="SharedVerifierState.Options"/>
internal OptionsCollection Options => _sharedState.Options;

[StringSyntax("C#-Test")] public new string TestCode { set => base.TestCode = value; }
[StringSyntax("C#-Test")] public new string FixedCode { set => base.FixedCode = value; }
Copy link
Member Author

Choose a reason for hiding this comment

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

allows syntax highlighting of test code.

@@ -244,6 +244,7 @@
<Compile Include="$(MSBuildThisFileDirectory)EmbeddedLanguages\Common\EmbeddedSyntaxToken.cs" />
<Compile Include="$(MSBuildThisFileDirectory)EmbeddedLanguages\Common\EmbeddedSyntaxTree.cs" />
<Compile Include="$(MSBuildThisFileDirectory)EmbeddedLanguages\Common\EmbeddedSyntaxTrivia.cs" />
<Compile Include="$(MSBuildThisFileDirectory)EmbeddedLanguages\PredefinedEmbeddedLanguageClassifierNames.cs" />
Copy link
Member Author

Choose a reason for hiding this comment

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

moved to shared file so we can reference the "CSharpTest" constant in the test files.

internal class ConvertNamespaceCodeRefactoringProvider : SyntaxEditorBasedCodeRefactoringProvider
[method: ImportingConstructor]
[method: SuppressMessage("RoslynDiagnosticsReliability", "RS0033:Importing constructor should be [Obsolete]", Justification = "Used in test code: https://github.com/dotnet/roslyn/issues/42814")]
internal class ConvertNamespaceCodeRefactoringProvider() : SyntaxEditorBasedCodeRefactoringProvider
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: seal?

@CyrusNajmabadi CyrusNajmabadi merged commit 105491f into dotnet:main Jul 1, 2024
25 checks passed
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Jul 1, 2024
@CyrusNajmabadi CyrusNajmabadi deleted the convertNamespace branch July 1, 2024 17:21
@RikkiGibson RikkiGibson modified the milestones: Next, 17.12 P1 Jul 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IDE0161 - Convert to file-scoped namespace reported on files with global namespace type declarations
4 participants