Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfdd628a

Browse files
[automated] Merge branch 'main' => 'main-vs-deps' (#79326)
I detected changes in the main branch which have not been merged yet tomain-vs-deps. I'm a robot and am configured to help you automaticallykeep main-vs-deps up to date, so I've opened this PR.This PR merges commits made on main by the following committers:* CyrusNajmabadi* jasonmalinowski## Instructions for merging from UIThis PR will not be auto-merged. When pull request checks pass, completethis PR by creating a merge commit, *not* a squash or rebase commit.<img alt="merge button instructions"src="https://i.imgur.com/GepcNJV.png" width="300" />If this repo does not allow creating merge commits from the GitHub UI,use command line instructions.## Instructions for merging via command lineRun these commands to merge this pull request from the command line.``` shgit fetchgit checkout maingit pull --ff-onlygit checkout main-vs-depsgit pull --ff-onlygit merge --no-ff main# If there are merge conflicts, resolve them and then run git merge --continue to complete the merge# Pushing the changes to the PR branch will re-trigger PR validation.git pushhttps://github.com/dotnet/roslyn HEAD:merge/main-to-main-vs-deps```<details><summary>or if you are using SSH</summary>```git push git@github.com:dotnet/roslyn HEAD:merge/main-to-main-vs-deps```</details>After PR checks are complete push the branch```git push```## Instructions for resolving conflicts:warning: If there are merge conflicts, you will need to resolve themmanually before merging. You can do this [using GitHub][resolve-github]or using the [command line][resolve-cli].[resolve-github]:https://help.github.com/articles/resolving-a-merge-conflict-on-github/[resolve-cli]:https://help.github.com/articles/resolving-a-merge-conflict-using-the-command-line/## Instructions for updating this pull requestContributors to this repo have permission update this pull request bypushing to the branch 'merge/main-to-main-vs-deps'. This can be done toresolve conflicts or make other changes to this pull request before itis merged.The provided examples assume that the remote is named 'origin'. If youhave a different remote name, please replace 'origin' with the name ofyour remote.```git fetchgit checkout -b merge/main-to-main-vs-deps origin/main-vs-depsgit pullhttps://github.com/dotnet/roslyn merge/main-to-main-vs-deps(make changes)git commit -m "Updated PR with my changes"git pushhttps://github.com/dotnet/roslyn HEAD:merge/main-to-main-vs-deps```<details> <summary>or if you are using SSH</summary>```git fetchgit checkout -b merge/main-to-main-vs-deps origin/main-vs-depsgit pull git@github.com:dotnet/roslyn merge/main-to-main-vs-deps(make changes)git commit -m "Updated PR with my changes"git push git@github.com:dotnet/roslyn HEAD:merge/main-to-main-vs-deps```</details>Contact .NET Core Engineering (dotnet/dnceng) if you have questions orissues.Also, if this PR was generated incorrectly, help us fix it. Seehttps://github.com/dotnet/arcade/blob/main/.github/workflows/scripts/inter-branch-merge.ps1.
2 parentsb1ef4a8 +70b6b82 commitfdd628a

File tree

577 files changed

+147530
-125487
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

577 files changed

+147530
-125487
lines changed

‎eng/targets/Settings.props

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
<!-- Set to non-existent file to prevent common targets from importing Microsoft.CodeAnalysis.targets-->
3535
<CodeAnalysisTargets>NON_EXISTENT_FILE</CodeAnalysisTargets>
3636

37-
<VisualStudioVersionCondition="'$(VisualStudioVersion)' == ''">15.0</VisualStudioVersion>
37+
<VisualStudioVersionCondition="'$(VisualStudioVersion)' == ''">17.0</VisualStudioVersion>
3838
<VisualStudioReferenceMajorVersionCondition="'$(VisualStudioReferenceMajorVersion)' == ''">$(VisualStudioVersion.Substring($([System.Convert]::ToInt32(0)), $(VisualStudioVersion.IndexOf('.'))))</VisualStudioReferenceMajorVersion>
3939
<VisualStudioReferenceAssemblyVersionCondition="'$(VisualStudioReferenceAssemblyVersion)' == ''">$(VisualStudioReferenceMajorVersion).0.0.0</VisualStudioReferenceAssemblyVersion>
4040
<MinimumVisualStudioVersion>$(VisualStudioVersion)</MinimumVisualStudioVersion>
@@ -137,11 +137,6 @@
137137
<CreateHardLinksForPublishFilesIfPossible>true</CreateHardLinksForPublishFilesIfPossible>
138138
</PropertyGroup>
139139

140-
<!-- Windows specific settings-->
141-
<PropertyGroupCondition="'$(OS)' == 'Windows_NT'">
142-
<DeployExtensionCondition="'$(VisualStudioVersion)' != '15.0' and '$(VisualStudioVersion)' != '16.0'">false</DeployExtension>
143-
</PropertyGroup>
144-
145140
<PropertyGroupCondition="'$(DevEnvDir)' == ''">
146141
<DevEnvDir>$([System.Environment]::ExpandEnvironmentVariables("%VS$(VisualStudioReferenceMajorVersion)0COMNTOOLS%"))</DevEnvDir>
147142
<DevEnvDir>$(DevEnvDir)\..\IDE</DevEnvDir>

‎src/Analyzers/CSharp/Analyzers/UseCollectionExpression/CSharpUseCollectionExpressionForBuilderDiagnosticAnalyzer.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ internal sealed partial class CSharpUseCollectionExpressionForBuilderDiagnosticA
2727
EnforceOnBuildValues.UseCollectionExpressionForBuilder)
2828
{
2929
privateconststringCreateBuilderName=nameof(ImmutableArray.CreateBuilder);
30-
privateconststringGetInstanceName=nameof(ArrayBuilder<int>.GetInstance);
30+
privateconststringGetInstanceName=nameof(ArrayBuilder<>.GetInstance);
3131

3232
protectedoverridevoidInitializeWorker(CodeBlockStartAnalysisContext<SyntaxKind>context,INamedTypeSymbol?expressionType)
3333
=>context.RegisterSyntaxNodeAction(context=>AnalyzeInvocationExpression(context,expressionType),SyntaxKind.InvocationExpression);
@@ -117,7 +117,7 @@ void FadeOutCode(SyntaxNodeAnalysisContext context, AnalysisResult analysisResul
117117
returnnull;
118118

119119
if(memberAccessExpression.Name.Identifier.ValueText==GetInstanceName&&
120-
memberAccessExpression.Expressionis notGenericNameSyntax{Identifier.ValueText:nameof(ArrayBuilder<int>)})
120+
memberAccessExpression.Expressionis notGenericNameSyntax{Identifier.ValueText:nameof(ArrayBuilder<>)})
121121
{
122122
returnnull;
123123
}
@@ -217,12 +217,12 @@ identifierName.Parent is MemberAccessExpressionSyntax(SyntaxKind.SimpleMemberAcc
217217
memberAccess.Expression==identifierName&&
218218
memberAccess.ParentisInvocationExpressionSyntax{ArgumentList.Arguments.Count:0}invocationExpression&&
219219
memberAccess.Name.Identifier.ValueText
220-
isnameof(ImmutableArray<int>.Builder.ToImmutable)
221-
ornameof(ImmutableArray<int>.Builder.MoveToImmutable)
222-
ornameof(ImmutableArray<int>.Builder.ToArray)
223-
ornameof(ArrayBuilder<int>.ToImmutableAndClear)
224-
ornameof(ArrayBuilder<int>.ToImmutableAndFree)
225-
ornameof(ArrayBuilder<int>.ToArrayAndFree)
220+
isnameof(ImmutableArray<>.Builder.ToImmutable)
221+
ornameof(ImmutableArray<>.Builder.MoveToImmutable)
222+
ornameof(ImmutableArray<>.Builder.ToArray)
223+
ornameof(ArrayBuilder<>.ToImmutableAndClear)
224+
ornameof(ArrayBuilder<>.ToImmutableAndFree)
225+
ornameof(ArrayBuilder<>.ToArrayAndFree)
226226
ornameof(Enumerable.ToList))
227227
{
228228
returninvocationExpression;

‎src/Analyzers/CSharp/Analyzers/UseCollectionExpression/CSharpUseCollectionExpressionForFluentDiagnosticAnalyzer.cs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -41,24 +41,24 @@ internal sealed partial class CSharpUseCollectionExpressionForFluentDiagnosticAn
4141
privatestaticreadonlyImmutableArray<string>s_suffixes=
4242
[
4343
nameof(Array),
44-
nameof(Span<int>),
45-
nameof(ReadOnlySpan<int>),
46-
nameof(System.Collections.Generic.List<int>),
47-
nameof(HashSet<int>),
48-
nameof(LinkedList<int>),
49-
nameof(Queue<int>),
50-
nameof(SortedSet<int>),
51-
nameof(Stack<int>),
52-
nameof(ICollection<int>),
53-
nameof(IReadOnlyCollection<int>),
54-
nameof(IList<int>),
55-
nameof(IReadOnlyList<int>),
56-
nameof(ImmutableArray<int>),
57-
nameof(ImmutableHashSet<int>),
58-
nameof(ImmutableList<int>),
59-
nameof(ImmutableQueue<int>),
60-
nameof(ImmutableSortedSet<int>),
61-
nameof(ImmutableStack<int>),
44+
nameof(Span<>),
45+
nameof(ReadOnlySpan<>),
46+
nameof(System.Collections.Generic.List<>),
47+
nameof(HashSet<>),
48+
nameof(LinkedList<>),
49+
nameof(Queue<>),
50+
nameof(SortedSet<>),
51+
nameof(Stack<>),
52+
nameof(ICollection<>),
53+
nameof(IReadOnlyCollection<>),
54+
nameof(IList<>),
55+
nameof(IReadOnlyList<>),
56+
nameof(ImmutableArray<>),
57+
nameof(ImmutableHashSet<>),
58+
nameof(ImmutableList<>),
59+
nameof(ImmutableQueue<>),
60+
nameof(ImmutableSortedSet<>),
61+
nameof(ImmutableStack<>),
6262
nameof(System.Collections.Immutable),
6363
];
6464

‎src/Analyzers/CSharp/Analyzers/UseCollectionExpression/CSharpUseCollectionExpressionForNewDiagnosticAnalyzer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ private void AnalyzeBaseObjectCreationExpression(
5353

5454
varsymbol=semanticModel.GetSymbolInfo(objectCreationExpression,cancellationToken).Symbol;
5555
if(symbolis notIMethodSymbol{MethodKind:MethodKind.Constructor,Parameters:[varconstructorParameter]}||
56-
constructorParameter.Type.Name!=nameof(IEnumerable<int>))
56+
constructorParameter.Type.Name!=nameof(IEnumerable<>))
5757
{
5858
return;
5959
}

‎src/Analyzers/CSharp/Analyzers/UseCollectionExpression/UseCollectionExpressionHelpers.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -193,11 +193,11 @@ bool IsSafeConversionWhenTypesDoNotMatch(out bool changesSemantics)
193193
varconvertedType=originalTypeInfo.ConvertedType;
194194

195195
varconvertedToReadOnlySpan=
196-
convertedType.Name==nameof(ReadOnlySpan<int>)&&
196+
convertedType.Name==nameof(ReadOnlySpan<>)&&
197197
convertedType.OriginalDefinition.Equals(compilation.ReadOnlySpanOfTType());
198198

199199
varconvertedToSpan=
200-
convertedType.Name==nameof(Span<int>)&&
200+
convertedType.Name==nameof(Span<>)&&
201201
convertedType.OriginalDefinition.Equals(compilation.SpanOfTType());
202202

203203
// ReadOnlySpan<X> x = stackalloc[] ...
@@ -206,7 +206,7 @@ bool IsSafeConversionWhenTypesDoNotMatch(out bool changesSemantics)
206206
// restrictive than Span<X>
207207
varisSpanToReadOnlySpan=
208208
convertedToReadOnlySpan&&
209-
type.Name==nameof(Span<int>)&&
209+
type.Name==nameof(Span<>)&&
210210
type.OriginalDefinition.Equals(compilation.SpanOfTType())&&
211211
convertedType.GetTypeArguments()[0].Equals(type.GetTypeArguments()[0]);
212212
if(isSpanToReadOnlySpan)
@@ -264,7 +264,7 @@ bool IsSafeConversionWhenTypesDoNotMatch(out bool changesSemantics)
264264
// disallow converting those types to ensure semantics are preserved. We do this even though
265265
// allowSemanticsChange is true because this will basically be certain to break semantics, as opposed to
266266
// the more common case where semantics may change slightly, but likely not in a way that breaks code.
267-
if(type.Nameisnameof(ObservableCollection<int>) ornameof(ReadOnlyObservableCollection<int>))
267+
if(type.Nameisnameof(ObservableCollection<>) ornameof(ReadOnlyObservableCollection<>))
268268
returnfalse;
269269

270270
// If the original expression was creating a set, but is being assigned to one of the well known
@@ -933,7 +933,7 @@ bool IsCompatibleSignatureAndArguments(
933933
{
934934
Type:INamedTypeSymbol
935935
{
936-
Name:nameof(IEnumerable<int>),
936+
Name:nameof(IEnumerable<>),
937937
TypeArguments:[ITypeParameterSymbol{TypeParameterKind:TypeParameterKind.Method}]
938938
}enumerableType
939939
}]&&
@@ -980,7 +980,7 @@ originalCreateMethod.Parameters is [
980980
{
981981
Type:INamedTypeSymbol
982982
{
983-
Name:nameof(Span<int>) ornameof(ReadOnlySpan<int>),
983+
Name:nameof(Span<>) ornameof(ReadOnlySpan<>),
984984
TypeArguments:[ITypeParameterSymbol{TypeParameterKind:TypeParameterKind.Method}]
985985
}spanType
986986
}])

‎src/Analyzers/CSharp/Analyzers/UseIndexOrRangeOperator/CSharpUseRangeOperatorDiagnosticAnalyzer.InfoCache.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ private MemberInfo ComputeMemberInfo(IMethodSymbol sliceLikeMethod, bool require
158158
// Also, look to see if the type has a `.Slice(int start, int length)` method.
159159
// This is also a method the compiler knows to look for when a user writes `x[a..b]`
160160
varactualSliceMethod=
161-
sliceLikeMethod.ContainingType.GetMembers(nameof(Span<int>.Slice))
161+
sliceLikeMethod.ContainingType.GetMembers(nameof(Span<>.Slice))
162162
.OfType<IMethodSymbol>()
163163
.FirstOrDefault(s=>IsTwoArgumentSliceLikeMethod(s));
164164
if(actualSliceMethod!=null)

‎src/Analyzers/CSharp/CodeFixes/MakeMethodAsynchronous/CSharpMakeMethodAsynchronousCodeFixProvider.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,13 +131,13 @@ private static TypeSyntax FixMethodReturnType(
131131
if(IsIEnumerable(returnType,knownTypes)&&IsIterator(methodSymbol,cancellationToken))
132132
{
133133
newReturnType=knownTypes.IAsyncEnumerableOfTTypeisnull
134-
?MakeGenericType(nameof(IAsyncEnumerable<int>),methodSymbol.ReturnType)
134+
?MakeGenericType(nameof(IAsyncEnumerable<>),methodSymbol.ReturnType)
135135
:knownTypes.IAsyncEnumerableOfTType.Construct(methodSymbol.ReturnType.GetTypeArguments()[0]).GenerateTypeSyntax();
136136
}
137137
elseif(IsIEnumerator(returnType,knownTypes)&&IsIterator(methodSymbol,cancellationToken))
138138
{
139139
newReturnType=knownTypes.IAsyncEnumeratorOfTTypeisnull
140-
?MakeGenericType(nameof(IAsyncEnumerator<int>),methodSymbol.ReturnType)
140+
?MakeGenericType(nameof(IAsyncEnumerator<>),methodSymbol.ReturnType)
141141
:knownTypes.IAsyncEnumeratorOfTType.Construct(methodSymbol.ReturnType.GetTypeArguments()[0]).GenerateTypeSyntax();
142142
}
143143
elseif(IsIAsyncEnumerableOrEnumerator(returnType,knownTypes))

‎src/Analyzers/CSharp/CodeFixes/UseUtf8StringLiteral/UseUtf8StringLiteralCodeFixProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ private static ExpressionSyntax CreateUtf8String(SyntaxTriviaList leadingTrivia,
206206
MemberAccessExpression(
207207
SyntaxKind.SimpleMemberAccessExpression,
208208
stringLiteral,
209-
IdentifierName(nameof(ReadOnlySpan<byte>.ToArray))))
209+
IdentifierName(nameof(ReadOnlySpan<>.ToArray))))
210210
.WithTrailingTrivia(trailingTrivia);
211211
}
212212
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp