Update analyzer deps / setup#185
Open
LinusCenterstrom wants to merge 2 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the MN.L10n Roslyn analyzer packaging and dependencies, removing the legacy VSIX-based distribution and shifting to NuGet packaging during build, while also making some analyzer code adjustments.
Changes:
- Removed the
MN.L10n.Analyzer.Vsixproject and its VSIX manifest from the solution. - Updated analyzer project packaging/dependency configuration (Roslyn component settings, PrivateAssets, version bump).
- Refactored
MNL10nAnalyzerto use a file-scoped namespace and nullable annotations, with small logic tweaks.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| MN.L10n.sln | Removes the VSIX project from the solution and build configurations. |
| MN.L10n.Analyzer/MN.L10n.Analyzer/MNL10nAnalyzer.cs | Refactors analyzer structure (file-scoped namespace, nullable) and adjusts analysis flow. |
| MN.L10n.Analyzer/MN.L10n.Analyzer/MN.L10n.Analyzer.csproj | Updates packaging settings and Roslyn dependency references; bumps package version. |
| MN.L10n.Analyzer/MN.L10n.Analyzer.Vsix/source.extension.vsixmanifest | Deletes VSIX manifest as VSIX packaging is removed. |
| MN.L10n.Analyzer/MN.L10n.Analyzer.Vsix/MN.L10n.Analyzer.Vsix.csproj | Deletes the VSIX project file. |
| MN.L10n.Analyzer/MN.L10n.Analyzer.Test/MN.L10n.Analyzer.Test.csproj | Updates Roslyn dependency version used by the test project. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The rule served no purpose, since _s requires at least one parameter to compile, we do not need an analyzer to validate that.
Comment on lines
+116
to
+132
| if (!(supposedArgument.Expression is ObjectCreationExpressionSyntax || supposedArgument.Expression is AnonymousObjectCreationExpressionSyntax || supposedArgument.Expression.RawKind == (int)SyntaxKind.NullLiteralExpression)) | ||
| { | ||
| obj.ReportDiagnostic(Diagnostic.Create(ArgumentsNotAnClassOrNullRule, obj.Node.GetLocation())); | ||
| } | ||
|
|
||
| if (arguments.Count > 1) | ||
| else | ||
| { | ||
| var supposedArgument = arguments[1]; | ||
|
|
||
| if (!(supposedArgument.Expression is ObjectCreationExpressionSyntax || supposedArgument.Expression is AnonymousObjectCreationExpressionSyntax || supposedArgument.Expression.RawKind == (int)SyntaxKind.NullLiteralExpression)) | ||
| if (l10nParameters == null || l10nParameters.Count == 0) | ||
| { | ||
| obj.ReportDiagnostic(Diagnostic.Create(ArgumentsNotAnClassOrNullRule, obj.Node.GetLocation())); | ||
| return; | ||
| } | ||
| else | ||
| { | ||
| if (l10nParameters == null || l10nParameters.Count == 0) | ||
| { | ||
| return; | ||
| } | ||
|
|
||
| var argumentAsObject = obj.SemanticModel.GetSymbolInfo(supposedArgument.Expression).Symbol; | ||
| var argumentAsObject = obj.SemanticModel.GetSymbolInfo(supposedArgument.Expression).Symbol; | ||
|
|
||
| var missingParameters = l10nParameters.Except(argumentAsObject.ContainingType.MemberNames.Select(p => $"${p}$")); | ||
| if (argumentAsObject == null) | ||
| { | ||
| return; | ||
| } |
itssimple
approved these changes
May 22, 2026
Member
itssimple
left a comment
There was a problem hiding this comment.
Missing the MN0001-rule, but maybe we don't want to use that any longer?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Updated the Analyzer (mostly dependencies).
Removed Vsix project for publishing, now we just package normally as a nuget when building instead.
Marked both CodeAnalysis nugets as PrivateAssets so they don't leak into consuming projects.
Fixed a few warnings
Removed the NoParam rule. It served no purpose since _s needs at least one parameter to compile, we do not need an analyzer to verify that at least one parameter is passed.