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 ParamsCollections #71150

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
0c3941c
Separate build and test phases in integration tests
arunchndr Oct 16, 2023
772c58d
Merge branch 'main' of https://github.com/dotnet/roslyn
arunchndr Oct 24, 2023
4100e4c
Add IVT from EA.Razor to MS.ANC.Razor.Test.Common.Tooling
DustinCampbell Dec 4, 2023
5236a2c
Merge branch 'main' of https://github.com/dotnet/roslyn
arunchndr Dec 4, 2023
e94a037
Disable ExtractMethod and VerifyTextSync after 17.9P1 failures
arunchndr Dec 4, 2023
9782a55
reset test-integration tweak in this PR
arunchndr Dec 4, 2023
681446f
Remove uncalled TS api
CyrusNajmabadi Dec 5, 2023
18009b9
Remove impls
CyrusNajmabadi Dec 5, 2023
aa62e88
REvert
CyrusNajmabadi Dec 5, 2023
e123b26
obsoletE
CyrusNajmabadi Dec 5, 2023
ca358ca
sort
CyrusNajmabadi Dec 5, 2023
f50ed04
text
CyrusNajmabadi Dec 5, 2023
8ffa18a
Be resilient to missing service
CyrusNajmabadi Dec 5, 2023
babb9ca
Fix use-collection-expr when it breaks type inference with arrays
CyrusNajmabadi Dec 5, 2023
52a2b7c
Move comment
CyrusNajmabadi Dec 5, 2023
d7f5e61
Merge pull request #71089 from dotnet/dev/arkalyan/disableintegration
arunchndr Dec 5, 2023
92a930f
Utilize IVsAsyncFileChangeEx2 (#70936)
ToddGrun Dec 6, 2023
0e267c8
Report diagnostics for inline array types that are not valid as type …
AlekseyTs Dec 6, 2023
85b7e0b
Merge pull request #71098 from CyrusNajmabadi/removeTSAPI
CyrusNajmabadi Dec 6, 2023
8be940c
Do not throw exceptions when validating numbers in json.net parsing mode
CyrusNajmabadi Dec 6, 2023
33ce035
Fix
CyrusNajmabadi Dec 6, 2023
37960a2
Write our own version
CyrusNajmabadi Dec 6, 2023
228d227
Add more tests
CyrusNajmabadi Dec 6, 2023
6ccd278
Add more tests
CyrusNajmabadi Dec 6, 2023
ed7bf95
raw strings
CyrusNajmabadi Dec 6, 2023
5c5aa73
raw strings
CyrusNajmabadi Dec 6, 2023
a1967f2
file scoped namespaces
CyrusNajmabadi Dec 6, 2023
c415baa
simplify tests
CyrusNajmabadi Dec 6, 2023
5289003
File scoped namespaces
CyrusNajmabadi Dec 6, 2023
3736d0a
simplify code
CyrusNajmabadi Dec 6, 2023
0282ea8
Bump msbuild logger in response to CI image upgrades
dibarbet Dec 6, 2023
244c53a
raw strings
CyrusNajmabadi Dec 6, 2023
86b8483
Do not offer to remove fields when converting to a primary constructo…
CyrusNajmabadi Dec 6, 2023
372d9eb
Simplify
CyrusNajmabadi Dec 6, 2023
12aa8f3
Use repo version of msbuild logger in buildboss
dibarbet Dec 6, 2023
84fa3e9
Merge pull request #71105 from CyrusNajmabadi/useCollectionExprInference
CyrusNajmabadi Dec 6, 2023
ad536a8
Use file scoped namespaces and primary cosntructors
CyrusNajmabadi Dec 6, 2023
cdfe46d
Use file scoped namespaces and primary cosntructors
CyrusNajmabadi Dec 6, 2023
9cd8877
Use file scoped namespaces and primary cosntructors
CyrusNajmabadi Dec 6, 2023
f53c33f
Use file scoped namespaces and primary cosntructors
CyrusNajmabadi Dec 6, 2023
fbad39d
Use file scoped namespaces and primary cosntructors
CyrusNajmabadi Dec 6, 2023
5ea6d4e
Use file scoped namespaces and primary cosntructors
CyrusNajmabadi Dec 6, 2023
bb36656
Use file scoped namespaces and primary cosntructors
CyrusNajmabadi Dec 6, 2023
56d2ecc
Fix 'use pattern matching' with nullable types
CyrusNajmabadi Dec 6, 2023
fbc8f1c
simplify
CyrusNajmabadi Dec 6, 2023
0f84ca0
simplify
CyrusNajmabadi Dec 6, 2023
c032c5b
Merge pull request #71125 from dibarbet/bump_msbuild_logger
dibarbet Dec 6, 2023
742f8eb
Fix DevContainer File (#71127)
jaredpar Dec 6, 2023
2a75aa3
Merge remote-tracking branch 'upstream/main' into usePrimaryConstruct…
CyrusNajmabadi Dec 6, 2023
11665f9
Merge remote-tracking branch 'upstream/main' into jsonNumbers
CyrusNajmabadi Dec 6, 2023
905a4f6
Merge remote-tracking branch 'upstream/main' into fsns
CyrusNajmabadi Dec 6, 2023
e12c52e
Merge remote-tracking branch 'upstream/main' into patternMatchingNull…
CyrusNajmabadi Dec 6, 2023
058bf2c
Merge pull request #71086 from DustinCampbell/ivt-for-razor
DustinCampbell Dec 6, 2023
ac2a155
Merge pull request #71130 from CyrusNajmabadi/patternMatchingNullable
CyrusNajmabadi Dec 6, 2023
0a7e377
Merge pull request #71126 from CyrusNajmabadi/usePrimaryConstructorNu…
CyrusNajmabadi Dec 6, 2023
6aab5d5
Merge pull request #71122 from CyrusNajmabadi/jsonNumbers
CyrusNajmabadi Dec 6, 2023
d0a733c
Merge pull request #71129 from CyrusNajmabadi/fsns
CyrusNajmabadi Dec 6, 2023
359a6aa
Support implicit indexer access in object initializers (#70649)
jcouv Dec 7, 2023
620aaf0
[main] Update dependencies from dotnet/arcade (#71116)
dotnet-maestro[bot] Dec 7, 2023
376b78a
Add "Params Collections" feature to Language Feature Status.md (#71138)
AlekseyTs Dec 7, 2023
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
4 changes: 1 addition & 3 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.192.0/containers/dotnet/.devcontainer/base.Dockerfile

# [Choice] .NET version: 6.0, 5.0, 3.1, 2.1
ARG VARIANT="6.0"
FROM mcr.microsoft.com/vscode/devcontainers/dotnet:0-${VARIANT}
FROM mcr.microsoft.com/vscode/devcontainers/dotnet:8.0

# Set up machine requirements to build the repo
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
Expand Down
97 changes: 50 additions & 47 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,56 +1,59 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.140.1/containers/dotnetcore
{
"name": "C# (.NET 6)",
"name": "C# (.NET 8)",
"build": {
"dockerfile": "Dockerfile",
"args": {
"VARIANT": "6.0",
}
},
"settings": {
"files.associations": {
"*.csproj": "msbuild",
"*.fsproj": "msbuild",
"*.globalconfig": "ini",
"*.manifest": "xml",
"*.nuspec": "xml",
"*.pkgdef": "ini",
"*.projitems": "msbuild",
"*.props": "msbuild",
"*.resx": "xml",
"*.rsp": "Powershell",
"*.ruleset": "xml",
"*.settings": "xml",
"*.shproj": "msbuild",
"*.slnf": "json",
"*.targets": "msbuild",
"*.vbproj": "msbuild",
"*.vsixmanifest": "xml",
"*.vstemplate": "xml",
"*.xlf": "xml",
"*.yml": "azure-pipelines"
},
// ms-dotnettools.csharp settings
"omnisharp.defaultLaunchSolution": "Roslyn.sln",
"omnisharp.disableMSBuildDiagnosticWarning": true,
"omnisharp.enableEditorConfigSupport": true,
"omnisharp.enableImportCompletion": true,
"omnisharp.useModernNet": true,
"omnisharp.enableAsyncCompletion": true,
// ms-vscode.powershell settings
"powershell.promptToUpdatePowerShell": false,
"powershell.integratedConsole.showOnStartup": false,
"powershell.startAutomatically": false,
// ms-azure-devops.azure-pipelines settings
"azure-pipelines.customSchemaFile": ".vscode/dnceng-schema.json"
"customizations": {
"vscode": {
"settings": {
"files.associations": {
"*.csproj": "msbuild",
"*.fsproj": "msbuild",
"*.globalconfig": "ini",
"*.manifest": "xml",
"*.nuspec": "xml",
"*.pkgdef": "ini",
"*.projitems": "msbuild",
"*.props": "msbuild",
"*.resx": "xml",
"*.rsp": "Powershell",
"*.ruleset": "xml",
"*.settings": "xml",
"*.shproj": "msbuild",
"*.slnf": "json",
"*.targets": "msbuild",
"*.vbproj": "msbuild",
"*.vsixmanifest": "xml",
"*.vstemplate": "xml",
"*.xlf": "xml",
"*.yml": "azure-pipelines"
},
// ms-dotnettools.csharp settings
"omnisharp.disableMSBuildDiagnosticWarning": true,
"omnisharp.enableEditorConfigSupport": true,
"omnisharp.enableImportCompletion": true,
"omnisharp.useModernNet": true,
"omnisharp.enableAsyncCompletion": true,
// ms-dotnettools.csdevkit settings
"dotnet.defaultSolution": "Roslyn.sln",
// ms-vscode.powershell settings
"powershell.promptToUpdatePowerShell": false,
"powershell.integratedConsole.showOnStartup": false,
"powershell.startAutomatically": false,
// ms-azure-devops.azure-pipelines settings
"azure-pipelines.customSchemaFile": ".vscode/dnceng-schema.json"
},
"extensions": [
"ms-dotnettools.csharp",
"ms-dotnettools.csdevkit",
"EditorConfig.EditorConfig",
"ms-vscode.powershell",
"tintoy.msbuild-project-tools",
"ms-azure-devops.azure-pipelines"
]
}
},
"extensions": [
"ms-dotnettools.csharp",
"EditorConfig.EditorConfig",
"ms-vscode.powershell",
"tintoy.msbuild-project-tools",
"ms-azure-devops.azure-pipelines"
],
"postCreateCommand": "${containerWorkspaceFolder}/restore.sh"
}
2 changes: 2 additions & 0 deletions docs/Language Feature Status.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ efforts behind them.

| Feature | Branch | State | Developer | Reviewer | IDE Buddy | LDM Champ |
| ------- | ------ | ----- | --------- | -------- | --------- | --------- |
| [Params-collections](https://github.com/dotnet/csharplang/issues/7700) | [ParamsCollections](https://github.com/dotnet/roslyn/tree/features/ParamsCollections) | [In Progress](https://github.com/dotnet/roslyn/issues/71137) | [AlekseyTs](https://github.com/AlekseyTs) | [RikkiGibson](https://github.com/RikkiGibson), [333fred](https://github.com/333fred) | | [MadsTorgersen](https://github.com/MadsTorgersen), [AlekseyTs](https://github.com/AlekseyTs) |
| [Semi-auto-properties](https://github.com/dotnet/csharplang/issues/140) | [semi-auto-props](https://github.com/dotnet/roslyn/tree/features/semi-auto-props) | [In Progress](https://github.com/dotnet/roslyn/issues/57012) | [Youssef1313](https://github.com/Youssef1313) | [333fred](https://github.com/333fred), [RikkiGibson](https://github.com/RikkiGibson) | | [CyrusNajmabadi](https://github.com/CyrusNajmabadi) |
| [Params Span\<T> + Stackalloc any array type](https://github.com/dotnet/csharplang/issues/1757) | [params-span](https://github.com/dotnet/roslyn/tree/features/params-span) | [In Progress](https://github.com/dotnet/roslyn/issues/57049) | [cston](https://github.com/cston) | TBD | | [jaredpar](https://github.com/jaredpar) |
| [Default in deconstruction](https://github.com/dotnet/roslyn/pull/25562) | [decon-default](https://github.com/dotnet/roslyn/tree/features/decon-default) | [In Progress](https://github.com/dotnet/roslyn/issues/25559) | [jcouv](https://github.com/jcouv) | [gafter](https://github.com/gafter) | | [jcouv](https://github.com/jcouv) |
| [Roles/Extensions](https://github.com/dotnet/csharplang/issues/5497) | [roles](https://github.com/dotnet/roslyn/tree/features/roles) | [In Progress](https://github.com/dotnet/roslyn/issues/66722) | [jcouv](https://github.com/jcouv) | [AlekseyTs](https://github.com/AlekseyTs), [jjonescz](https://github.com/jjonescz) | | [MadsTorgersen](https://github.com/MadsTorgersen) |
| [Escape character](https://github.com/dotnet/csharplang/issues/7400) | N/A | [In Progress](https://github.com/dotnet/roslyn/pull/70497) | [CyrusNajmabadi](https://github.com/CyrusNajmabadi) | [jcouv](https://github.com/jcouv), [RikkiGibson](https://github.com/RikkiGibson) | | [CyrusNajmabadi](https://github.com/CyrusNajmabadi) |
| [Method group natural type improvements](https://github.com/dotnet/csharplang/blob/main/proposals/method-group-natural-type-improvements.md) | main | In Progress | [jcouv](https://github.com/jcouv) | [AlekseyTs](https://github.com/AlekseyTs), [cston](https://github.com/cston) | | [jcouv](https://github.com/jcouv) |
| Implicit indexer access in object initializers | main | Merged into 17.9p3 | [jcouv](https://github.com/jcouv) | | | |

# C# 12.0

Expand Down
12 changes: 6 additions & 6 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@
</Dependency>
</ProductDependencies>
<ToolsetDependencies>
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="9.0.0-beta.23604.3">
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="9.0.0-beta.23606.1">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>29736c3a40dc33e94b8a7fdf72dad6d441f9e46f</Sha>
<Sha>71149d1f281ab5e066d1f524f4862152683f5144</Sha>
<SourceBuild RepoName="arcade" ManagedOnly="true" />
</Dependency>
<Dependency Name="Microsoft.DotNet.XliffTasks" Version="9.0.0-beta.23604.3">
<Dependency Name="Microsoft.DotNet.XliffTasks" Version="9.0.0-beta.23606.1">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>29736c3a40dc33e94b8a7fdf72dad6d441f9e46f</Sha>
<Sha>71149d1f281ab5e066d1f524f4862152683f5144</Sha>
</Dependency>
<Dependency Name="Microsoft.DiaSymReader" Version="2.0.0">
<Uri>https://github.com/dotnet/symreader</Uri>
Expand All @@ -49,9 +49,9 @@
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>5d10d428050c0d6afef30a072c4ae68776621877</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="9.0.0-beta.23604.3">
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="9.0.0-beta.23606.1">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>29736c3a40dc33e94b8a7fdf72dad6d441f9e46f</Sha>
<Sha>71149d1f281ab5e066d1f524f4862152683f5144</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.NetAnalyzers" Version="8.0.0-preview.23468.1">
<Uri>https://github.com/dotnet/roslyn-analyzers</Uri>
Expand Down
2 changes: 1 addition & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@
<MicrosoftVisualStudioWorkspaceVSIntegrationVersion>17.1.11-preview-0002</MicrosoftVisualStudioWorkspaceVSIntegrationVersion>
<MicrosoftWin32PrimitivesVersion>4.3.0</MicrosoftWin32PrimitivesVersion>
<MicrosoftWin32RegistryVersion>5.0.0</MicrosoftWin32RegistryVersion>
<MSBuildStructuredLoggerVersion>2.1.858</MSBuildStructuredLoggerVersion>
<MSBuildStructuredLoggerVersion>2.2.100</MSBuildStructuredLoggerVersion>
<MDbgVersion>0.1.0</MDbgVersion>
<MonoOptionsVersion>6.6.0.161</MonoOptionsVersion>
<MoqVersion>4.10.1</MoqVersion>
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": "17.8.1-2"
},
"msbuild-sdks": {
"Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.23604.3",
"Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.23604.3"
"Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.23606.1",
"Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.23606.1"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

using System.Collections.Immutable;
using System.Diagnostics;
using System.Linq;
using System.Threading;
using Microsoft.CodeAnalysis.CodeStyle;
using Microsoft.CodeAnalysis.CSharp.Syntax;
Expand All @@ -14,6 +15,8 @@

namespace Microsoft.CodeAnalysis.CSharp.UseCollectionExpression;

using static SyntaxFactory;

[DiagnosticAnalyzer(LanguageNames.CSharp)]
internal sealed partial class CSharpUseCollectionExpressionForArrayDiagnosticAnalyzer()
: AbstractCSharpUseCollectionExpressionDiagnosticAnalyzer(
Expand Down Expand Up @@ -116,8 +119,14 @@ private void AnalyzeArrayInitializerExpression(SyntaxNodeAnalysisContext context
? (ExpressionSyntax)initializer.GetRequiredParent()
: initializer;

// Have to actually examine what would happen when we do the replacement, as the replaced value may interact
// with inference based on the values within.
var replacementCollectionExpression = CollectionExpression(
SeparatedList<CollectionElementSyntax>(initializer.Expressions.Select(ExpressionElement)));

if (!UseCollectionExpressionHelpers.CanReplaceWithCollectionExpression(
semanticModel, arrayCreationExpression, expressionType, skipVerificationForReplacedNode: true, cancellationToken))
semanticModel, arrayCreationExpression, replacementCollectionExpression,
expressionType, skipVerificationForReplacedNode: true, cancellationToken))
{
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,21 @@ public static bool CanReplaceWithCollectionExpression(
INamedTypeSymbol? expressionType,
bool skipVerificationForReplacedNode,
CancellationToken cancellationToken)
{
// To keep things simple, all we do is replace the existing expression with the `[]` literal.This is an
// 'untyped' collection expression literal, so it tells us if the new code will have any issues moving to
// something untyped. This will also tell us if we have any ambiguities (because there are multiple destination
// types that could accept the collection expression).
return CanReplaceWithCollectionExpression(semanticModel, expression, s_emptyCollectionExpression, expressionType, skipVerificationForReplacedNode, cancellationToken);
}

public static bool CanReplaceWithCollectionExpression(
SemanticModel semanticModel,
ExpressionSyntax expression,
CollectionExpressionSyntax replacementExpression,
INamedTypeSymbol? expressionType,
bool skipVerificationForReplacedNode,
CancellationToken cancellationToken)
{
var compilation = semanticModel.Compilation;

Expand Down Expand Up @@ -91,13 +106,10 @@ public static bool CanReplaceWithCollectionExpression(
return IsConstructibleCollectionType(semanticModel.GetTypeInfo(parent, cancellationToken).Type);

// Looks good as something to replace. Now check the semantics of making the replacement to see if there would
// any issues. To keep things simple, all we do is replace the existing expression with the `[]` literal. This
// is an 'untyped' collection expression literal, so it tells us if the new code will have any issues moving to
// something untyped. This will also tell us if we have any ambiguities (because there are multiple destination
// types that could accept the collection expression).
// any issues.
var speculationAnalyzer = new SpeculationAnalyzer(
topMostExpression,
s_emptyCollectionExpression,
replacementExpression,
semanticModel,
cancellationToken,
skipVerificationForReplacedNode,
Expand Down
Loading
Loading