Skip to content

Commit a98e3fd

Browse files
333fredCyrusNajmabadiToddGrundibarbetjasonmalinowski
authored
Merge main (#78994)
* Simpli * Simplify * Simplify * docs * docs * Clear * Update src/Workspaces/Core/Portable/FindSymbols/Shared/AbstractSyntaxIndex_Persistence.cs * Remove method * Fix ILBuilder visualization (#78764) Turns out that we do have visualization of in-progress IL building, but it's been broken since 2020, when we renamed Roslyn.Test.Utilities to Microsoft.CodeAnalysis.Test.Utilities. It was then further broken by the change a few months ago to pass IL visualization formats along. This gets the debugger display working again. * Remove EditorFeaturesWpf TestComposition (#78769) After the EditorFeatures.WPF => EditorFeatures refactoring, this TestComposition became equivalent to the EditorFeatures one, so just removing the WPF one. * Fix renames across different extensions * Add docs * Add docs * Update src/VisualStudio/Core/Def/PackageRegistration.pkgdef * Explicitly reset * Reset state * Add docs * Simplify * Revert * Simplify * Simplify * Docs * Update src/VisualStudio/Core/Def/Commands.vsct Co-authored-by: David Barbet <[email protected]> * Update src/VisualStudio/Core/Impl/SolutionExplorer/SymbolTree/SymbolItemContextMenuController.cs Co-authored-by: David Barbet <[email protected]> * Simplify * Simplify * multi notify * only if it changed * Don't move backwards * Docs * Update src/VisualStudio/Core/Impl/SolutionExplorer/SymbolTree/SymbolTreeChildCollection.cs * Ensure sln load uses project absolute paths * lint * Rename field to make it clearer what it's used for It's only for dynamic files, so make that clear. * Don't refresh dynamic files under a lock When we were getting the notification of a dynamic file being changed, we were taking the project and workspace locks before fetching the actual content. This is really expensive now that the fetching itself might not be instant. Fundamentally this change is just switching the work to acquire the locks to get the setup info, then releasing the locks and calling the provider to get the info. I'm putting this around a batching queue so we can deduplicate lots of events at once, and also to ensure ordering so if we were to try refreshing the document more than once we don't end up in a case where we have two threads trying to put different versions of the document into the workspace and getting the ordering wrong. Fixes #78734 * Fix cast before we unsubscribe This was otherwise throwing an exception every shutdown. * Adjust implementation to respect diagnostic flag and update tests * Remove workarounds for bugs that have been fixed Closes #77995 * Remove a workaround we had for an old version of Copilot This bug was fixed a long time ago. * Switch return to continue * Fixed multi-variable declaration support in RemoveUnnecessarySuppressions. * Removed whitespace. Co-authored-by: DoctorKrolic <[email protected]> * Simplified TestRemoveDiagnosticSuppression_Attribute_MultiVariableDeclaration with inline data. * Expanded remove unnecessary suppression tests, removed unnecessary loop and fixed partial method/property support in AbstractRemoveUnnecessaryInlineSuppressionsDiagnosticAnalyzer. * Directly create virtual project when dotnet run-api is missing for now * Avoid dereferencing null CheckConstraintsArgs.CurrentCompilation (#78729) Fixes #78430. * Updates to unblock dartlab pipeline (#78793) * update timeout * wip * Add main to main-vs-deps flow (#78798) * Create branch-merge2.jsonc * Update main-merge.yml * Rename branch-merge2.jsonc to branch-merge-2.jsonc * Update PublishData.json * Update and rename branch-merge.jsonc to main-to-main-vs-deps-branch-merge.jsonc * feedbacl * make clear main is for validation * EnC: Simplify diagnostic reporting (#78708) * Refactoring of extension methods in source packages (#78620) * Change namespace of OneOrMany and TemporaryArray to MS.CA.Collections * Cleanup Enumerable and ImmutableArray extensions * Update imports/usings * Fix VB remove-imports not showing up * add the schedule back to main-merge (#78807) * Fix LSP references for using alias * Clean up HasDuplicates extension method (#78808) * Extensions: Do not consider extension block methods as entry points, consider their implementation methods instead (#78667) * Decouple EditorFeatures.Test.Utilities from VS services Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities depended on Microsoft.VisualStudio.Editor which brought along various VS layer services. Further, we had some stub implementations of those VS services there. Digging into this this coupling wasn't really necessary: 1. There were EditorFeatures tests using the editor adapters stub, but those tests pass just fine without it, so that was easy to move to the VS specific tests. 2. StubVsServiceExporters didn't appear to be used either, so unsure why those were in this layer at all. Those were also moved. 3. We had implementations of some settings services, which it's easier to just delete and remove the options persister from the composition in the first place. This also better ensures that we don't have code that might try creating registry keys from ILocalRegistry which we absolutely don't want. * Extensions: mark skeleton type with 'specialname' (#78690) * Fix await completion in an async iterator * Extensions: fix lowering of implicit conversion on receiver in pattern-based scenarios (#78685) * Add test * Find metadata reference for alias * Add a fallback path when launching the BuildHost * refactor * Added notes to update GetBuildHostPath if packaging changes * Update comments * Add heuristic for the loaded from nuget package scenario * Fix corruption of sliding text window when trying to peek backwards. (#78774) Co-authored-by: Fred Silberberg <[email protected]> * Track changed text instead of clearing immediate window. * EnC: Partial solution updates (#78744) * Restore some parts of the progression api some legacy components (like codemap) use. * Remove unused internal APIs * Remove unused internal APIs * Remove unused internal APIs * Remove unused internal APIs * Make static * Simplify * Avoid ignored directive errors in disabled regions (#78158) * Extensions: use specific tracking issues for different areas (#78834) * Extensions: relax inferrability rule (#78758) * Remove blank line output from the node writer proportional to the number of non-abstract nodes (#78844) * Revert "Refactoring of extension methods in source packages (#78620)" (#78850) This reverts commit 917401d, broke typescript * Switch off of mutlidictionary (#78851) This is from ICSharpCompiler, and is therefore causing unnecessary dll loads. * Switch behavior of "Go to definition" and "Go to implementation" for partial members * Fix LSP tests * Fix peek test * Switch to existing helpers for multi-dictionary use * call TryGetValue to get dictionary entry (#78863) * Remove more progression code * Remove more progression code * Remove more progression code * Remove more progression code * Remove more progression code * Remove more progression code * Remove more progression code * Remove more progression code * Add VSTypeScriptAsynchronousTaggerProvider2 for TypeScript that avoids TemporaryArray (#78866) * Remove more progression code * Remove more progression code * Remove more progression code * Remove more progression code * Fix build break (#78870) * Add more ETW events to trace assembly loading (#78840) * Add more ETW events to trace assembly loading * Update src/Compilers/Core/Portable/CodeAnalysisEventSource.Common.cs Co-authored-by: Joey Robichaud <[email protected]> * Put correct alc reference * Use binary literals --------- Co-authored-by: Joey Robichaud <[email protected]> * Introduce EA layer for TS to integrate with classification * Simplify * Add CommandLineResource API (#78679) * Revert "Revert "Refactoring of extension methods in source packages (#78620)" (#78850)" This reverts commit e083be9. * Fix * Revert "Fix" This reverts commit 574935d. * Revert "Revert "Revert "Refactoring of extension methods in source packages (#78620)" (#78850)"" This reverts commit 27ae586. * Lint * Remove all progression code * Revert * remove code * Fix * Reduce allocations under ContextMutableIntervalTree (#78885) There are some closure allocations unnecessarilly happening during ContextMutableIntervalTree construction. Simply changed a couple methods to static and added a parameter for the extra bit of data they need to get rid of those allocations. This is a very small improvement, only about 0.1% (6 MB) of allocations during typing in the razor speedometer test. * Reduce allocations in the ImageElementConverter and ImageIdConverter Read methods (#78881) * Reduce allocations in the ImageElementConverter and ImageIdConverter Read methods These methods show up in the typing scenario in the razor speedometer test as about 0.9% (63 MB) of allocations. 1) Changed ImageIdConverter to be more like ImageElementConverter and not create a JsonDocument object to query 2) Changed several Utf8JsonReader.GetText calls to instead use Utf8JsonReader.CopyString 3) Changed JsonElement.GetString and new Guid(...) to instead use Utf8JsonReader.GetGuid() Note that if this PR is merged, I'll also try to make a change to vslanguageserverclient to also do the same as that code has the same issues. * Fix issue serializing null options in VB * Yield in task continuation to prevent stack overflow * Move to .NET 10 Preview 5 * Remove RemoteControl workaround * Lint response * Lint response * Lint response * Lint response * Lint response * Fix issue with not resetting valueLength (#78890) * Fix issue with not resetting valueLength #78881 was just merged with a small bug, in that valueLength wasn't reset before it was used a second time. If the typeName is > 64 chars, then this would have thrown a different exception than it should have down a couple lines. * remove unused method * Lint response * Lint response * fix compiler side * Simplify workspace hookup in syntactic tagger * Move * Switch to ITextBuffer2 * REvert * REvert * Update src/EditorFeatures/Core/InlineDiagnostics/AbstractDiagnosticsTaggerProvider.cs * Update src/EditorFeatures/Core/StringIndentation/StringIndentationTaggerProvider.cs * Update src/EditorFeatures/Core/Tagging/AsynchronousViewportTaggerProvider.cs * REvert * remove more workspace registration code * Move to .NET 10 Preview 5 (#78906) * Move to .NET 10 Preview 5 * Lint response * Lint response * Lint response * Lint response * Lint response * remove unused method * Lint response * Lint response * fix compiler side * more --------- Co-authored-by: Cyrus Najmabadi <[email protected]> * Fix * Inline Hints - do not allow double click for collection expression type hint (#78900) * do not allow double click for collection expression hint * Update src/EditorFeatures/Test2/InlineHints/CSharpInlineTypeHintsTests.vb Co-authored-by: Cyrus Najmabadi <[email protected]> * comment --------- Co-authored-by: Cyrus Najmabadi <[email protected]> * Add tests * Revert "Update code to use null propagation (#78733)" This reverts commit d785549, reversing changes made to a8808be. * Revert "Move to .NET 10 Preview 5 (#78906)" This reverts commit a7fa681. * fix warning * Revert "Update to using unbound nameof(X<>) expressions (#78731)" This reverts commit 6a09280, reversing changes made to a7fa681. * Revert "Update to using simple untyped lambdas (#78732)" This reverts commit a8808be, reversing changes made to 6a09280. * Fix OOP crash issue with copilot change analysis * Re-enable IDE0051 (#78919) This re-enables the unused member analyzer and removes all of the methods it flagged as unused. * Extensions: address some follow-up comments (#78847) * Pass missing Hot Reload result properties (#78929) * Fix deadlock if an MSBuild task is writing to stdout When we switched over to communicating over a named pipe rather than stdin/stdout, we were still redirecting stdin and stdout. This had the side effect that if a build task was directly writing to standard out, the build would eventually deadlock since we weren't reading from the other side. I thought about simply not redirecting stdin/stdout, but I could imagine other problems might come up if we were to have multiple build hosts trying to share stdin/stdout. So now we'll log stdout the same way we log stderr, and explicitly close stdin so readers won't deadlock waiting for input. Fixes #78766 * Revert * Collect stats * Extensions: allow cref references to extension members (#78735) * Fix scoped variance checks involving ref struct interface implementation (#78883) * Remove now unused Progression references and related hacks * Expose a couple of things to Razor * Remove more unneeded references * Obsolete api * [main] Source code updates from dotnet/dotnet (#78805) * [VMR] Codeflow a528f84-a528f84 [[ commit created by automation ]] * Update dependencies from https://github.com/dotnet/dotnet build 270315 No dependency updates to commit * [VMR] Codeflow f5faea9-f5faea9 [[ commit created by automation ]] * Update dependencies from https://github.com/dotnet/dotnet build 270450 No dependency updates to commit * Update dependencies from https://github.com/dotnet/dotnet build 270603 No dependency updates to commit * Update dependencies from https://github.com/dotnet/dotnet build 270662 No dependency updates to commit * [VMR] Codeflow 86826d3-86826d3 [[ commit created by automation ]] * Update dependencies from https://github.com/dotnet/dotnet build 271018 No dependency updates to commit * [VMR] Codeflow 32a2620-32a2620 [[ commit created by automation ]] * Update dependencies from https://github.com/dotnet/dotnet build 271181 No dependency updates to commit * [VMR] Codeflow 25357a9-25357a9 [[ commit created by automation ]] * Update dependencies from https://github.com/dotnet/dotnet build 271343 No dependency updates to commit * Update dependencies from https://github.com/dotnet/dotnet build 271417 No dependency updates to commit * Revert incorrect Roslyn.sln changes --------- Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com> Co-authored-by: Viktor Hofer <[email protected]> * Code simplification * Specify single reducer * Simplify * Add test * Only add annotations to potential references * :Extract type * Docs * move up * Expose `IsIterator` as a public API (#78813) * Expose `IsIterator` as a public API * Fix workspace generated method symbol implementation * Implement new property in yet another non-compiler-owned method symbol implementation * SemanticSearch.ReferenceAssemblies * Verify public code path in C# * Add negative tests * Add C# local function tests * Test VB lambda iterators * Revert accessibility change * Disable warnings * Use explicit type * Simplify lambda tests * Test interface property * Add additional VB case * Update enum values * PR Feedback --------- Co-authored-by: Cyrus Najmabadi <[email protected]> Co-authored-by: Cyrus Najmabadi <[email protected]> Co-authored-by: Todd Grunke <[email protected]> Co-authored-by: David Barbet <[email protected]> Co-authored-by: David Barbet <[email protected]> Co-authored-by: Jason Malinowski <[email protected]> Co-authored-by: John Douglas Leitch <[email protected]> Co-authored-by: DoctorKrolic <[email protected]> Co-authored-by: Rikki Gibson <[email protected]> Co-authored-by: AlekseyTs <[email protected]> Co-authored-by: Ankita Khera <[email protected]> Co-authored-by: Tomáš Matoušek <[email protected]> Co-authored-by: Julien Couvreur <[email protected]> Co-authored-by: Joey Robichaud <[email protected]> Co-authored-by: Jan Jones <[email protected]> Co-authored-by: DoctorKrolic <[email protected]> Co-authored-by: Chris Sienkiewicz <[email protected]> Co-authored-by: Joey Robichaud <[email protected]> Co-authored-by: tmat <[email protected]> Co-authored-by: Jared Parsons <[email protected]> Co-authored-by: David Wengier <[email protected]> Co-authored-by: dotnet-maestro[bot] <42748379+dotnet-maestro[bot]@users.noreply.github.com> Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com> Co-authored-by: Viktor Hofer <[email protected]>
2 parents 31b2f02 + 057349d commit a98e3fd

File tree

451 files changed

+16647
-11416
lines changed

Some content is hidden

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

451 files changed

+16647
-11416
lines changed

.github/workflows/main-merge.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
name: Inter-branch merge
44
on:
5-
# schedule:
6-
# # Create a merge every 3 hours (works only for merges from `main`, others would need a `push` trigger).
7-
# - cron: '0 */3 * * *'
5+
schedule:
6+
# Create a merge every 3 hours (works only for merges from `main`, others would need a `push` trigger).
7+
- cron: '0 */3 * * *'
88
workflow_dispatch:
99
inputs:
1010
configuration_file_branch:
@@ -21,5 +21,6 @@ jobs:
2121
if: github.repository == 'dotnet/roslyn'
2222
uses: dotnet/arcade/.github/workflows/inter-branch-merge-base.yml@main
2323
with:
24-
configuration_file_path: 'eng/config/branch-merge.jsonc'
24+
configuration_file_path: 'eng/config/main-to-main-vs-deps-branch-merge.jsonc'
2525
configuration_file_branch: ${{ inputs.configuration_file_branch || 'main' }}
26+

Roslyn.sln

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Microsoft Visual Studio Solution File, Format Version 12.00
2-
# Visual Studio Version 17
3-
VisualStudioVersion = 17.0.31319.15
2+
# Visual Studio Version 18
3+
VisualStudioVersion = 18.0.10623.112 main
44
MinimumVisualStudioVersion = 10.0.40219.1
55
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RoslynDeployment", "src\Deployment\RoslynDeployment.csproj", "{600AF682-E097-407B-AD85-EE3CED37E680}"
66
EndProject
@@ -2207,8 +2207,11 @@ Global
22072207
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\VisualBasicWorkspaceExtensions.projitems*{57ca988d-f010-4bf2-9a2e-07d6dcd2ff2c}*SharedItemsImports = 5
22082208
src\Analyzers\CSharp\Tests\CSharpAnalyzers.UnitTests.projitems*{58969243-7f59-4236-93d0-c93b81f569b3}*SharedItemsImports = 13
22092209
src\Dependencies\Collections\Microsoft.CodeAnalysis.Collections.projitems*{5f8d2414-064a-4b3a-9b42-8e2a04246be5}*SharedItemsImports = 5
2210+
src\Dependencies\Contracts\Microsoft.CodeAnalysis.Contracts.projitems*{5f8d2414-064a-4b3a-9b42-8e2a04246be5}*SharedItemsImports = 5
22102211
src\Dependencies\PooledObjects\Microsoft.CodeAnalysis.PooledObjects.projitems*{5f8d2414-064a-4b3a-9b42-8e2a04246be5}*SharedItemsImports = 5
2212+
src\Dependencies\Threading\Microsoft.CodeAnalysis.Threading.projitems*{5f8d2414-064a-4b3a-9b42-8e2a04246be5}*SharedItemsImports = 5
22112213
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CompilerExtensions.projitems*{5f8d2414-064a-4b3a-9b42-8e2a04246be5}*SharedItemsImports = 5
2214+
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Microsoft.CodeAnalysis.Extensions.projitems*{5f8d2414-064a-4b3a-9b42-8e2a04246be5}*SharedItemsImports = 5
22122215
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\WorkspaceExtensions.projitems*{5f8d2414-064a-4b3a-9b42-8e2a04246be5}*SharedItemsImports = 5
22132216
src\Analyzers\Core\CodeFixes\CodeFixes.projitems*{5ff1e493-69cc-4d0b-83f2-039f469a04e1}*SharedItemsImports = 5
22142217
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\WorkspaceExtensions.projitems*{5ff1e493-69cc-4d0b-83f2-039f469a04e1}*SharedItemsImports = 5

eng/Directory.Packages.props

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,6 @@
6666
<PackageVersion Include="Microsoft.VisualStudio.Extensibility.JsonGenerators.Sdk" Version="17.12.2037-preview3" />
6767
<PackageVersion Include="Microsoft.VSSDK.Debugger.VSDConfigTool" Version="17.13.1100801-preview" />
6868
<PackageVersion Include="Microsoft.VisualStudio.ProjectSystem" Version="17.0.77-pre-g62a6cb5699" />
69-
<PackageVersion Include="Microsoft.VisualStudio.Progression.CodeSchema" Version="15.8.27812-alpha" />
70-
<PackageVersion Include="Microsoft.VisualStudio.Progression.Common" Version="15.8.27812-alpha" />
71-
<PackageVersion Include="Microsoft.VisualStudio.Progression.Interfaces" Version="15.8.27812-alpha" />
7269
<PackageVersion Include="Microsoft.VisualStudio.CallHierarchy.Package.Definitions" Version="15.8.27812-alpha" />
7370
<PackageVersion Include="Microsoft.VisualStudio.CodeAnalysis.Sdk.UI" Version="15.8.27812-alpha" />
7471
<PackageVersion Include="Microsoft.VisualStudio.Language.CallHierarchy" Version="15.8.27812-alpha" />
@@ -99,14 +96,12 @@
9996
<PackageVersion Include="Microsoft.VisualStudio.CoreUtility" Version="17.13.226" />
10097
<PackageVersion Include="Microsoft.VisualStudio.Editor" Version="17.13.226" />
10198
<PackageVersion Include="Microsoft.VisualStudio.ImageCatalog" Version="17.13.40008" />
102-
<PackageVersion Include="Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime" Version="17.13.40008" />
10399
<PackageVersion Include="Microsoft.VisualStudio.Language" Version="17.13.226" />
104100
<PackageVersion Include="Microsoft.VisualStudio.Language.NavigateTo.Interfaces" Version="17.13.226" />
105101
<PackageVersion Include="Microsoft.VisualStudio.Language.StandardClassification" Version="17.13.226" />
106102
<PackageVersion Include="Microsoft.VisualStudio.LanguageServer.Client" Version="17.13.33" />
107103
<PackageVersion Include="Microsoft.VisualStudio.RemoteControl" Version="16.3.52" />
108104
<PackageVersion Include="Microsoft.VisualStudio.RpcContracts" Version="17.13.7" />
109-
<PackageVersion Include="Microsoft.VisualStudio.Shell.15.0" Version="17.13.40008" />
110105
<PackageVersion Include="Microsoft.VisualStudio.Telemetry" Version="17.14.8" />
111106
<PackageVersion Include="Microsoft.VisualStudio.Text.Data" Version="17.13.226" />
112107
<PackageVersion Include="Microsoft.VisualStudio.Text.Logic" Version="17.13.226" />

eng/Version.Details.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Dependencies>
3-
<Source Uri="https://github.com/dotnet/dotnet" Mapping="roslyn" Sha="57b0396ae0d21b9f0dfe0d208c57822fb88f9a8d" BarId="269724" />
3+
<Source Uri="https://github.com/dotnet/dotnet" Mapping="roslyn" Sha="25bec1af21db71468c5c2c3a588dd54d0e058e9d" BarId="271417" />
44
<ProductDependencies>
55
<!-- RoslynAnalyzers reference older builds of Roslyn and this is necessary for SourceBuild. -->
66
<Dependency Name="Microsoft.CodeAnalysis" Version="3.11.0">

eng/build.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ function TestUsingRunTests() {
440440
}
441441

442442
} elseif ($testVsi) {
443-
$args += " --timeout 110"
443+
$args += " --timeout 220"
444444
$args += " --runtime both"
445445
$args += " --sequential"
446446
$args += " --include '\.IntegrationTests'"

eng/config/PublishData.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,15 @@
176176
"insertionCreateDraftPR": false
177177
},
178178
"main": {
179+
"nugetKind": [
180+
"Shipping",
181+
"NonShipping"
182+
],
183+
"vsBranch": "main",
184+
"insertionCreateDraftPR": true,
185+
"insertionTitlePrefix": "[Validation]"
186+
},
187+
"main-vs-deps": {
179188
"nugetKind": [
180189
"Shipping",
181190
"NonShipping"

eng/config/branch-merge.jsonc

Lines changed: 0 additions & 9 deletions
This file was deleted.

eng/config/globalconfigs/Common.globalconfig

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,6 @@ dotnet_diagnostic.VSTHRD010.severity = none
127127
# VSTHRD110: Observe result of async calls
128128
dotnet_diagnostic.VSTHRD110.severity = none
129129

130-
# Workaround for old Microsoft.VisualStudio.Progression.* packages: https://github.com/dotnet/roslyn/issues/71404
131-
dotnet_diagnostic.VSIXCompatibility1001.severity = none
132-
133130
dotnet_diagnostic.HAA0101.severity = none
134131
dotnet_diagnostic.HAA0102.severity = none
135132
dotnet_diagnostic.HAA0201.severity = none
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// Used by .github/workflows/main-merge.yml
2+
{
3+
"merge-flow-configurations": {
4+
// Merge any main changes to main-vs-deps.
5+
"main": {
6+
"MergeToBranch": "main-vs-deps",
7+
"ExtraSwitches": "-QuietComments"
8+
}
9+
}
10+
}

eng/targets/Settings.props

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@
1111

1212
<VSSDKTargetPlatformRegRootSuffix>RoslynDev</VSSDKTargetPlatformRegRootSuffix>
1313

14-
<!-- Workaround for old Microsoft.VisualStudio.Progression.* packages -->
15-
<NoWarn>$(NoWarn);VSIXCompatibility1001</NoWarn>
16-
1714
<!-- TODO: https://github.com/dotnet/roslyn/issues/71667 -->
1815
<NoWarn>$(NoWarn);NU1507</NoWarn>
1916

@@ -120,6 +117,7 @@
120117
<MicrosoftCodeAnalysisLanguageServerKey>002400000480000094000000060200000024000052534131000400000100010009f3c8fcb7cb2592cc6e6d3646d4d9a2bda9e7a243d357bc17a5a06f50ed0dae74a343cd9538fe45bbc90a3f7cbecb23558205e3b246b69f7f7730e520460d560da1c68cda9e2256e3b801629e2dc1fd588b1681aaf4f2c98abcfc50086ecbcd55f76f7dbaf018e708527d8ae3a2714b3ec9b62bd9aaf56cf55b3ffc9eee31aa</MicrosoftCodeAnalysisLanguageServerKey>
121118
<MicrosoftCodeAnalysisCompilerDeveloperSDKKey>00240000048000009400000006020000002400005253413100040000010001005984d9e99e5722bb74ddbb59972bff1a2fd9e0ccb2d50e09ef85e39ec4a4e4bf2de896997de1af164be0558cdd5a50a283b9353fc4e5ccc1c87363e6e7d87af7bec8ca40281596fc8f5b5aad9904230f6f3892f8dde382cee7ba9854004d86ce93834a86b42ebdd0faf86d9fa6d935e05aed68cb4d828cea77df028739aaa9dc</MicrosoftCodeAnalysisCompilerDeveloperSDKKey>
122119
<CopilotKey>002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293</CopilotKey>
120+
<AIToolsKey>$(MicrosoftSharedPublicKey)</AIToolsKey>
123121
</PropertyGroup>
124122

125123
<!--

src/Analyzers/Core/Analyzers/RemoveUnnecessarySuppressions/AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs

Lines changed: 63 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -759,62 +759,78 @@ private async Task<bool> ProcessSuppressMessageAttributesAsync(
759759
continue;
760760
}
761761

762-
var symbols = SemanticFacts.GetDeclaredSymbols(semanticModel, node, cancellationToken);
763-
foreach (var symbol in symbols)
762+
// In the case of declaration nodes that can have more than one symbol e.g. fields and events,
763+
// the attributes are shared between then. Given this, we only need to inspect the first symbol
764+
// of the node.
765+
var symbol = SemanticFacts
766+
.GetDeclaredSymbols(semanticModel, node, cancellationToken)
767+
.FirstOrDefault();
768+
769+
// If we somehow do not have a symbol, we can't do anything. Otherwise, check if our symbol is
770+
// a partial definition. If it is, skip it in favor of checking the implementation.
771+
if (symbol is null or
772+
IMethodSymbol { IsPartialDefinition: true } or
773+
IPropertySymbol { IsPartialDefinition: true })
764774
{
765-
switch (symbol?.Kind)
766-
{
767-
// Local SuppressMessageAttributes are only applicable for types and members.
768-
case SymbolKind.NamedType:
769-
case SymbolKind.Method:
770-
case SymbolKind.Field:
771-
case SymbolKind.Property:
772-
case SymbolKind.Event:
773-
break;
774-
775-
default:
776-
continue;
777-
}
775+
continue;
776+
}
778777

779-
// Skip already processed symbols from partial declarations
780-
var isPartial = symbol.Locations.Length > 1;
781-
if (isPartial && !processedPartialSymbols.Add(symbol))
782-
{
778+
switch (symbol?.Kind)
779+
{
780+
// Local SuppressMessageAttributes are only applicable for types and members.
781+
case SymbolKind.NamedType:
782+
case SymbolKind.Method:
783+
case SymbolKind.Field:
784+
case SymbolKind.Property:
785+
case SymbolKind.Event:
786+
break;
787+
788+
default:
783789
continue;
784-
}
790+
}
791+
792+
// Skip already processed symbols from partial declarations
793+
var isPartial = symbol.Locations.Length > 1;
785794

786-
foreach (var attribute in symbol.GetAttributes())
795+
if (isPartial && !processedPartialSymbols.Add(symbol))
796+
{
797+
continue;
798+
}
799+
800+
foreach (var attribute in symbol.GetAttributes())
801+
{
802+
if (attribute.ApplicationSyntaxReference != null &&
803+
TryGetSuppressedDiagnosticId(attribute, suppressMessageAttributeType, out var id, out var category))
787804
{
788-
if (attribute.ApplicationSyntaxReference != null &&
789-
TryGetSuppressedDiagnosticId(attribute, suppressMessageAttributeType, out var id, out var category))
805+
// Ignore unsupported IDs and those excluded through user option.
806+
if (!IsSupportedAnalyzerDiagnosticId(id) ||
807+
userIdExclusions.Contains(id, StringComparer.OrdinalIgnoreCase) ||
808+
category?.Length > 0 && userCategoryExclusions.Contains(category, StringComparer.OrdinalIgnoreCase))
809+
{
810+
continue;
811+
}
812+
813+
if (!idToSuppressMessageAttributesMap.TryGetValue(id, out var nodesForId))
790814
{
791-
// Ignore unsupported IDs and those excluded through user option.
792-
if (!IsSupportedAnalyzerDiagnosticId(id) ||
793-
userIdExclusions.Contains(id, StringComparer.OrdinalIgnoreCase) ||
794-
category?.Length > 0 && userCategoryExclusions.Contains(category, StringComparer.OrdinalIgnoreCase))
795-
{
796-
continue;
797-
}
798-
799-
if (!idToSuppressMessageAttributesMap.TryGetValue(id, out var nodesForId))
800-
{
801-
nodesForId = [];
802-
idToSuppressMessageAttributesMap.Add(id, nodesForId);
803-
}
804-
805-
var attributeNode = await attribute.ApplicationSyntaxReference.GetSyntaxAsync(cancellationToken).ConfigureAwait(false);
806-
nodesForId.Add(attributeNode);
807-
808-
// Initialize the attribute node as unnecessary at the start of the algorithm.
809-
// Later processing will identify attributes which are indeed responsible for suppressing diagnostics
810-
// and mark them as used.
811-
// NOTE: For attributes on partial symbols with multiple declarations, we conservatively
812-
// consider them as used and avoid unnecessary attribute analysis because that would potentially
813-
// require analysis across multiple files, which can be expensive from a performance standpoint.
814-
suppressMessageAttributesToIsUsedMap.Add(attributeNode, isPartial);
815+
nodesForId = [];
816+
idToSuppressMessageAttributesMap.Add(id, nodesForId);
815817
}
818+
819+
var attributeNode = await attribute.ApplicationSyntaxReference.GetSyntaxAsync(cancellationToken).ConfigureAwait(false);
820+
nodesForId.Add(attributeNode);
821+
822+
// Initialize the attribute node as unnecessary at the start of the algorithm.
823+
// Later processing will identify attributes which are indeed responsible for suppressing diagnostics
824+
// and mark them as used.
825+
// NOTE: For attributes on partial symbols with multiple declarations, we conservatively
826+
// consider them as used and avoid unnecessary attribute analysis because that would potentially
827+
// require analysis across multiple files, which can be expensive from a performance standpoint.
828+
suppressMessageAttributesToIsUsedMap.Add(attributeNode, isPartial);
816829
}
817830
}
831+
832+
// Individual variables within a variable declaration cannot be decorated with distinct attributes, so we
833+
// should avoid looking at any of the subsequent symbols for this node as they will be the same.
818834
}
819835
}
820836

src/Analyzers/VisualBasic/Tests/RemoveUnnecessaryImports/RemoveUnnecessaryImportsTests.vb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1323,5 +1323,17 @@ End Namespace
13231323
parseOptions:=TestOptions.Regular,
13241324
compilationOptions:=TestOptions.ReleaseExe.WithGlobalImports({GlobalImport.Parse("System"), GlobalImport.Parse("Goo"), GlobalImport.Parse("Bar")}))
13251325
End Function
1326+
1327+
<Fact, WorkItem("https://github.com/dotnet/roslyn/issues/78799")>
1328+
Public Async Function TestExplicitSelectionOfFullImportStatement() As Task
1329+
Await TestAsync(
1330+
"[|Imports System.Collections.Generic|]
1331+
1332+
Class C
1333+
End Class",
1334+
"Class C
1335+
End Class",
1336+
TestOptions.Regular)
1337+
End Function
13261338
End Class
13271339
End Namespace

src/Compilers/CSharp/Portable/Binder/Binder.ValueChecks.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3029,13 +3029,13 @@ private bool CheckInvocationArgMixingWithUpdatedRules(
30293029
}
30303030
}
30313031

3032-
inferDeclarationExpressionValEscape();
3032+
inferDeclarationExpressionValEscape(argsOpt, localScopeDepth, escapeValues);
30333033

30343034
mixableArguments.Free();
30353035
escapeValues.Free();
30363036
return valid;
30373037

3038-
void inferDeclarationExpressionValEscape()
3038+
void inferDeclarationExpressionValEscape(ImmutableArray<BoundExpression> argsOpt, SafeContext localScopeDepth, ArrayBuilder<EscapeValue> escapeValues)
30393039
{
30403040
// find the widest scope that arguments could safely escape to.
30413041
// use this scope as the inferred STE of declaration expressions.

src/Compilers/CSharp/Portable/Binder/Binder_Conversions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2286,7 +2286,7 @@ private static void CheckParameterModifierMismatchMethodConversion(SyntaxNode sy
22862286
return;
22872287
}
22882288

2289-
if (SourceMemberContainerTypeSymbol.RequiresValidScopedOverrideForRefSafety(delegateMethod))
2289+
if (SourceMemberContainerTypeSymbol.RequiresValidScopedOverrideForRefSafety(delegateMethod, lambdaOrMethod.TryGetThisParameter(out var thisParameter) ? thisParameter : null))
22902290
{
22912291
SourceMemberContainerTypeSymbol.CheckValidScopedOverride(
22922292
delegateMethod,

0 commit comments

Comments
 (0)