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.
Issue URL: #3904
Collectionexpressions are detected as variable declarations and not as InitializerExpression.
Previously they where checked based on the declaration itself (so we only have 1 Item e.g.
var myVariable = [1,2,3])
. Now, for collection initializations we get the SyntaxNode from the variable and then validate each item of the collection on its own.Since this is my first open source contribution feedback is very welcome.
I also found 2 points where I'm not sure how to proceed with:
Microsoft.CodeAnalysis.CSharp
is installed with V.1.2.1 @Stylecop.Analyzers. V.4.7.0 introduced theCollectionExpressionSyntax
that would simply myIsCollectionExpression()
to just a type check basiclly. Also the "workaround" with that id could be removed so imo it would be way cleaner, due to beeing 3 Major Versions behind i didnt wanted to update, since i basiclly dont know the project and also what could be affected by that upgrade.