Skip to content

Update analyzer deps / setup#185

Open
LinusCenterstrom wants to merge 2 commits into
masterfrom
update-analyzer
Open

Update analyzer deps / setup#185
LinusCenterstrom wants to merge 2 commits into
masterfrom
update-analyzer

Conversation

@LinusCenterstrom
Copy link
Copy Markdown
Collaborator

@LinusCenterstrom LinusCenterstrom commented May 22, 2026

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.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.Vsix project and its VSIX manifest from the solution.
  • Updated analyzer project packaging/dependency configuration (Roslyn component settings, PrivateAssets, version bump).
  • Refactored MNL10nAnalyzer to 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.

Comment thread MN.L10n.Analyzer/MN.L10n.Analyzer/MNL10nAnalyzer.cs Outdated
Comment thread MN.L10n.Analyzer/MN.L10n.Analyzer/MNL10nAnalyzer.cs
The rule served no purpose, since _s requires at least one parameter to compile, we do not need an analyzer to validate that.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

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;
}
Copy link
Copy Markdown
Member

@itssimple itssimple left a comment

Choose a reason for hiding this comment

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

Missing the MN0001-rule, but maybe we don't want to use that any longer?

Comment thread MN.L10n.Analyzer/MN.L10n.Analyzer/MNL10nAnalyzer.cs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants