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

Merge main to features/required-members #58493

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
35b0a04
use the end of the span instead of the start to determine line position
akhera99 Dec 17, 2021
8df82f3
Fix leak in _hostAnalyzerStateMap
mavasani Dec 18, 2021
1c3ac57
Merge pull request #58398 from akhera99/bugs/inline_diagnostics_multi…
akhera99 Dec 20, 2021
55c4ba9
Remove unnecessary weakref valuessources in compilation tracker.
CyrusNajmabadi Dec 20, 2021
36beb71
REmove value-source as everything in constant
CyrusNajmabadi Dec 20, 2021
f62f574
Remove unnecessary assertion that CancellationSeries is disposed
sharwell Dec 16, 2021
999ff1e
Inline another value always known to be a constnat value source.
CyrusNajmabadi Dec 20, 2021
24bd3eb
Add contract
CyrusNajmabadi Dec 20, 2021
8316b81
Remove specific ValueSource subclass that is no longer used
CyrusNajmabadi Dec 20, 2021
d19870c
Add initial test for inline diagnostics tagger
sharwell Dec 20, 2021
e3fd8e2
Update underling-reassigned-variable to understand suppressed variabl…
CyrusNajmabadi Dec 20, 2021
421642e
Merge pull request #58426 from sharwell/unnecessary-assertion
sharwell Dec 20, 2021
9a00071
Merge pull request #58427 from sharwell/inline-diags-test
sharwell Dec 20, 2021
dd7d3de
Allow null args
CyrusNajmabadi Dec 20, 2021
49fe335
NRT
CyrusNajmabadi Dec 20, 2021
288782a
Initial trial
CyrusNajmabadi Dec 20, 2021
0ec375f
Further work
CyrusNajmabadi Dec 20, 2021
1f3bc64
Merge pull request #58428 from CyrusNajmabadi/underlineSuppression
CyrusNajmabadi Dec 20, 2021
a8553a0
Before trivia moving
CyrusNajmabadi Dec 20, 2021
7fe6edd
Update formatting
CyrusNajmabadi Dec 20, 2021
9897eb2
Update tests
CyrusNajmabadi Dec 20, 2021
0cc31fa
Add tests
CyrusNajmabadi Dec 21, 2021
6b8bf3b
Update src/Analyzers/CSharp/CodeFixes/ConvertNamespace/ConvertNamespa…
CyrusNajmabadi Dec 21, 2021
e01c235
Remove unused message argument (#58432)
333fred Dec 21, 2021
6d4210e
Fix
CyrusNajmabadi Dec 21, 2021
6d52178
Simplify further
CyrusNajmabadi Dec 21, 2021
f4d2678
ove files
CyrusNajmabadi Dec 21, 2021
d795813
Merge branch 'convertNSWork' of https://github.com/CyrusNajmabadi/ros…
CyrusNajmabadi Dec 21, 2021
f6d8885
Move file
CyrusNajmabadi Dec 21, 2021
c064f9e
Fix tests
CyrusNajmabadi Dec 21, 2021
63d6adb
lint
CyrusNajmabadi Dec 21, 2021
9c96271
Merge pull request #58425 from CyrusNajmabadi/compilationTrackerWR
CyrusNajmabadi Dec 21, 2021
559ca97
Merge pull request #58434 from CyrusNajmabadi/convertNSWork
CyrusNajmabadi Dec 21, 2021
8ef33d0
Merge pull request #58406 from mavasani/FixLeak
mavasani Dec 21, 2021
2dab552
Use ElasticSpace instead of ElasticZeroSpace (#58152)
davidwengier Dec 21, 2021
e9d15a7
set compilers.sln as the default solution when opening with VS Code
jmarolf Dec 21, 2021
79c8b92
Support TestWorkspace with multiple source generated files
sharwell Dec 21, 2021
5c75cfe
Merge pull request #58454 from jmarolf/infrastructure/set-compilers-s…
jmarolf Dec 22, 2021
7812951
Support TestWorkspace with source generated files without full XML sy…
sharwell Dec 21, 2021
be874ec
Clear prior build errors for additional and analyzer config docs at s…
mavasani Dec 22, 2021
e343cb0
Fix MakeFieldReadonly false positive for ref assignments
mavasani Dec 22, 2021
bf84ccf
Merge pull request #58459 from mavasani/IDE0044_FP
mavasani Dec 22, 2021
5a6a566
[main] Update dependencies from dotnet/arcade (#58408)
dotnet-maestro[bot] Dec 22, 2021
6ea8af0
Merge pull request #58457 from mavasani/RazorBug
mavasani Dec 22, 2021
01cbd62
Merge pull request #58455 from sharwell/sg-testing
sharwell Dec 23, 2021
d589d90
Update dependencies from https://github.com/dotnet/arcade build 20211…
dotnet-maestro[bot] Dec 23, 2021
678b269
Support top level statements in event hookup (#58475)
davidwengier Dec 24, 2021
8fb8592
Fix event hookup at the end of a document (#58477)
davidwengier Dec 24, 2021
6e9947a
Enqueue additional and analyzer config documents in WorkCoordinator
mavasani Dec 24, 2021
ce24c90
Fix unused param (IDE0060) false positive
mavasani Dec 24, 2021
bbb2c26
Address feedback
mavasani Dec 24, 2021
e7b9d14
Fix build
mavasani Dec 24, 2021
9f3de42
draft (#58481)
Youssef1313 Dec 24, 2021
957f8b3
Merge pull request #58479 from mavasani/WorkcoordinatorFix
mavasani Dec 24, 2021
05b2c02
Merge pull request #58480 from mavasani/IDE0060_FP
mavasani Dec 24, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"files.associations": {
"**/eng/pipelines/*.yml": "azure-pipelines"
}
},
"omnisharp.defaultLaunchSolution": "Compilers.sln",
}
8 changes: 4 additions & 4 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@
</Dependency>
</ProductDependencies>
<ToolsetDependencies>
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="7.0.0-beta.21615.1">
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="7.0.0-beta.21623.1">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>943d03f62955c771825dfa1f1bdeb8f853a2d7dd</Sha>
<Sha>4abaab2bf44d06638abeb23fc96c4f6eef58a2f0</Sha>
<SourceBuild RepoName="arcade" ManagedOnly="true" />
</Dependency>
<Dependency Name="Microsoft.Net.Compilers.Toolset" Version="4.1.0-2.21609.7">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>818313426323d979747781a17c78860c833776da</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="7.0.0-beta.21615.1">
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="7.0.0-beta.21623.1">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>943d03f62955c771825dfa1f1bdeb8f853a2d7dd</Sha>
<Sha>4abaab2bf44d06638abeb23fc96c4f6eef58a2f0</Sha>
</Dependency>
</ToolsetDependencies>
</Dependencies>
3 changes: 3 additions & 0 deletions eng/common/dotnet-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ case $cpuname in
aarch64)
buildarch=arm64
;;
loongarch64)
buildarch=loongarch64
;;
amd64|x86_64)
buildarch=x64
;;
Expand Down
3 changes: 2 additions & 1 deletion eng/common/native/CommonLibrary.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,8 @@ function Get-MachineArchitecture {
}
if (($ProcessorArchitecture -Eq "AMD64") -Or
($ProcessorArchitecture -Eq "IA64") -Or
($ProcessorArchitecture -Eq "ARM64")) {
($ProcessorArchitecture -Eq "ARM64") -Or
($ProcessorArchitecture -Eq "LOONGARCH64")) {
return "x64"
}
return "x86"
Expand Down
4 changes: 2 additions & 2 deletions global.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"xcopy-msbuild": "16.10.0-preview2"
},
"msbuild-sdks": {
"Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.21615.1",
"Microsoft.DotNet.Helix.Sdk": "7.0.0-beta.21615.1"
"Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.21623.1",
"Microsoft.DotNet.Helix.Sdk": "7.0.0-beta.21623.1"
}
}
5 changes: 3 additions & 2 deletions src/Analyzers/CSharp/CodeFixes/CSharpCodeFixes.projitems
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
<Compile Include="$(MSBuildThisFileDirectory)AddAccessibilityModifiers\CSharpAddAccessibilityModifiersCodeFixProvider.cs" />
<Compile Include="$(MSBuildThisFileDirectory)AddAccessibilityModifiers\CSharpAddAccessibilityModifiersService.cs" />
<Compile Include="$(MSBuildThisFileDirectory)AddBraces\CSharpAddBracesCodeFixProvider.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ConvertNamespace\ConvertNamespaceCodeFixProvider.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ConvertNamespace\ConvertNamespaceTransform.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ConvertTypeOfToNameOf\CSharpConvertTypeOfToNameOfCodeFixProvider.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.Rewriter.cs" />
Expand Down Expand Up @@ -78,4 +76,7 @@
<ItemGroup Condition="'$(DefaultLanguageSourceExtension)' != '' AND '$(BuildingInsideVisualStudio)' != 'true'">
<ExpectedCompile Include="$(MSBuildThisFileDirectory)**\*$(DefaultLanguageSourceExtension)" />
</ItemGroup>
<ItemGroup>
<Folder Include="$(MSBuildThisFileDirectory)ConvertNamespace\" />
</ItemGroup>
</Project>

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -1717,13 +1717,13 @@ await TestInRegularAndScript1Async(
}

[WorkItem(46785, "https://github.com/dotnet/roslyn/issues/46785")]
[Fact(Skip = "https://github.com/dotnet/roslyn/issues/46785"), Trait(Traits.Feature, Traits.Features.CodeActionsMakeFieldReadonly)]
[Fact, Trait(Traits.Feature, Traits.Features.CodeActionsMakeFieldReadonly)]
public async Task UsedAsRef_NoDiagnostic()
{
await TestMissingInRegularAndScriptAsync(
@"public class C
{
private string [|_x|] = string.Empty;
private string [|x|] = string.Empty;

public bool M()
{
Expand All @@ -1733,6 +1733,26 @@ public bool M()
}");
}

[WorkItem(57983, "https://github.com/dotnet/roslyn/issues/57983")]
[Fact, Trait(Traits.Feature, Traits.Features.CodeActionsMakeFieldReadonly)]
public async Task UsedAsRef_NoDiagnostic_02()
{
await TestMissingInRegularAndScriptAsync(
@"using System.Runtime.CompilerServices;

public class Test
{
private ulong [|nextD3D12ComputeFenceValue|];

internal void Repro()
{
ref ulong d3D12FenceValue = ref Unsafe.NullRef<ulong>();
d3D12FenceValue = ref nextD3D12ComputeFenceValue;
d3D12FenceValue++;
}
}");
}

[WorkItem(42760, "https://github.com/dotnet/roslyn/issues/42760")]
[Fact, Trait(Traits.Feature, Traits.Features.CodeActionsMakeFieldReadonly)]
public async Task WithThreadStaticAttribute_NoDiagnostic()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2120,7 +2120,7 @@ void M()
{
void M()
{
#ifA || B
#if A || B
#endif
}
}",
Expand Down Expand Up @@ -2151,6 +2151,32 @@ void M()
offeredWhenRequireForClarityIsEnabled: true, index: 1);
}

[WorkItem(57768, "https://github.com/dotnet/roslyn/issues/57768")]
[Fact, Trait(Traits.Feature, Traits.Features.CodeActionsRemoveUnnecessaryParentheses)]
public async Task TestParensAroundPPDirective3()
{
await TestAsync(
@"class C
{
void M()
{
#if C
#elif$$(A || B)
#endif
}
}",
@"class C
{
void M()
{
#if C
#elif A || B
#endif
}
}",
offeredWhenRequireForClarityIsEnabled: true);
}

[WorkItem(29454, "https://github.com/dotnet/roslyn/issues/29454")]
[Fact, Trait(Traits.Feature, Traits.Features.CodeActionsRemoveUnnecessaryParentheses)]
public async Task TestMissingForPreIncrement()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1503,6 +1503,36 @@ public C(int [|i|])
}");
}

[WorkItem(56317, "https://github.com/dotnet/roslyn/issues/56317")]
[Fact, Trait(Traits.Feature, Traits.Features.CodeActionsRemoveUnusedParameters)]
public async Task NotImplementedException_NoDiagnostic4()
{
await TestDiagnosticMissingAsync(
@"using System;

class C
{
private int Goo(int [|i|])
=> throw new NotImplementedException();
}");
}

[WorkItem(56317, "https://github.com/dotnet/roslyn/issues/56317")]
[Fact, Trait(Traits.Feature, Traits.Features.CodeActionsRemoveUnusedParameters)]
public async Task NotImplementedException_NoDiagnostic5()
{
await TestDiagnosticMissingAsync(
@"using System;

class C
{
private int Goo(int [|i|])
{
throw new NotImplementedException();
}
}");
}

[WorkItem(41236, "https://github.com/dotnet/roslyn/issues/41236")]
[Fact, Trait(Traits.Feature, Traits.Features.CodeActionsRemoveUnusedParameters)]
public async Task NotImplementedException_MultipleStatements1()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,18 @@ static bool IsSingleThrowNotImplementedOperation(IOperation firstBlock)
if (firstOp == null)
return false;

// unwrap: { throw new NYI(); }
if (firstOp is IExpressionStatementOperation expressionStatement)
{
// unwrap: { throw new NYI(); }
firstOp = expressionStatement.Operation;
}
else if (firstOp is IReturnOperation returnOperation)
{
// unwrap: 'int M(int p) => throw new NYI();'
// For this case, the throw operation is wrapped within a conversion operation to 'int',
// which in turn is wrapped within a return operation.
firstOp = returnOperation.ReturnedValue.WalkDownConversion();
}

// => throw new NotImplementedOperation(...)
return IsThrowNotImplementedOperation(notImplementedExceptionType, firstOp);
Expand All @@ -177,7 +186,7 @@ static bool IsSingleThrowNotImplementedOperation(IOperation firstBlock)
return firstOp;
}

static bool IsThrowNotImplementedOperation(INamedTypeSymbol notImplementedExceptionType, IOperation operation)
static bool IsThrowNotImplementedOperation(INamedTypeSymbol notImplementedExceptionType, IOperation? operation)
=> operation is IThrowOperation throwOperation &&
UnwrapImplicitConversion(throwOperation.Exception) is IObjectCreationOperation objectCreation &&
notImplementedExceptionType.Equals(objectCreation.Type);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ internal static void ReportReservedTypeName(string? name, CSharpCompilation comp
{
if (compilation.LanguageVersion >= MessageID.IDS_FeatureRecords.RequiredVersion())
{
diagnostics.Add(ErrorCode.WRN_RecordNamedDisallowed, location, name);
diagnostics.Add(ErrorCode.WRN_RecordNamedDisallowed, location);
}
}
else if (IsReservedTypeName(name))
Expand Down
Loading