Skip to content

Commit

Permalink
Snap 17.3 P2 (#61618)
Browse files Browse the repository at this point in the history
* Avoid caching RelativeIndentationData.effectiveBaseToken

* Relax assertion in SyntheticBoundNodeFactory.Convert (#61287)

* Add missing node state transition

It's valid for an input to be modified causing a downstream input to be removed (for example a syntax tree can change what is in it, leading to the downstream node not generating something). 

//cc @jkoritzinsky in case I'm missing something obvious.

* Simplify logic, more tests, rework tests

* Fix several LSP completion kind mappings (#61243)

* Fix several LSP completion kind mappings

* Extension method

* Fix issue where we were getting a raw-string in a skipped token, causing a crash

* Add test

* Add an UWP OptProf test for IDE

* Disable smart copy/paste when line-copy is involved.

* Update src/EditorFeatures/CSharp/StringCopyPaste/StringCopyPasteCommandHandler.cs

* Add additional sanity check

* Fix

* Add pointer for `AnalysisLevel` to warning waves doc (#61196)

* Remove parameter null-checking from the Language Feature Status list (#61302)

* Switch to GetRequiredService

* Simpler approach

* [EE] Implement IDkmClrFullNameProvider2 in Roslyn's ResultProvider Formatter. (#60522)

* Implement IDkmClrFullNameProvider2 in Roslyn's ResultProvider Formatter.

Issue:
- Debugger added IDkmClrFullNameProvider2 API with https://devdiv.visualstudio.com/DevDiv/_git/Concord/pullrequest/301518
- It is currently temporarily implement in Concord, needs to be implemented in Roslyn so implementation can be removed from Concord.

Changes:
1. Formatter:
- Implement IDkmClrFullNameProvider2. It has 2 methods, one to format local names and the other given field metadata.
- Currently only implemented for C#. I'm not that familiar with VB and the GeneratedNames stuff in VB needs some splitting and moving around to get working.

2. Unit tests:
- Add unit tests for the common cases of hoisted locals, synthesized locals, etc.

3. Versions.props:
Update MicrosoftVSSDKVSDConfigToolVersion to a newer version which recognizes IDkmClrFullNameProvider2.

* PR feedback - fix casing of MetadataImport

* PR feedback - move GetOriginalLocalVariableName, GetOriginalFieldName back to CSharpFormatter

Co-authored-by: Ramkumar Ramesh <ramram@microsoft.com>

* PR feedback

* Fix and/or completion after parenthesized pattern

* [LSP] Disable GoToDef/GoToImpl integration tests  (#61190)

* Added syntax context flag

* Keywords c#

* Keep leadin trivia inside Main method if it is more likely to be a statement comment rather than a file header when converting to 'Program.Main' style program

* Symbols

* Snippets C#

* Remove set accessor of new SyntaxContext property

* Remove PROTOTYPE comments (#61322)

* Added assertions, comments, and refactored for clarity

* Change VB language version Roslyn.sln uses to "latest" (#61313)

To allow us to use the latest VB features, such as setting init-only properties.

* PR feedback

* Remove document options provider (#61228)

* Remove IDocumentOptionsProvider

* Fold DocumentSpecificOptionSet into DocumentOptionSet

* Use an explicit option to control frozen-partial semantics in inheritance margin

* Break into separate methods

* Fix null ref (#61342)

* Simplify internal types search

* Removed unintentional WorkItem's

* Make static

* PR feedback

* [LSP] Support LSP services associated with LSP server instances (with lifetimes that match). (#61266)

* Add support for exporting services that are created for each server
instance.

* Use the correct span to rename after invoking extract-method manually.

* Move Spellcheck capabilities to be activated in all scenarios (#61366)

* move spellcheck capability to always activated server

* Rename type

* rename fields

* [LSP] Add JSON semantic token classifications (#61231)

* Make async

* Test fallout

* Unify nint and IntPtr (#60913)

* restore file

* Minor simplification to rename code

* Remaining fallback options (#60888)

* Add missing fallbacks

* Fallback options from ILegacyGlobalOptionsWorkspaceService

* Pass options to CodeCleaner APIs.

* Fallback options from ILegacyGlobalOptionsWorkspaceService 2

* Fallback in tests

* CodeModel

* Remove CodeActionOptions.Default

* Remove dependency on IGlobalOptionService from inline hints service

* Remove obsolete VS UnitTesting APIs.

* Remote dependency on IGlobalOption service from RemoteProcessTelemetryService

* Remove ExportGlobalOptionProviderAttribute

* Remove PythiaOptions

* Remove DiagnosticOptions from solution snapshot

* Access options via AnalyzerOptionsProvider

* Split ISyntaxFormatting.cs

* Simplify initializers

* Fix

* Move AddImportPlacementOptions to a separate file in compiler extensions

* Move option providers to workspace extensions

* Move CodeCleanupOptions and IdeAnalyzerOptions to workspace extensions

* Layering

* Replace legacy GetOptions with AnalyzerOptionsProvider; add missing options

* Parameter rename, comment

* Add LineFormattingOptionsProviders

* CodeFixOptionsProvider, include CodeStyleOptions in CodeActionOptions, include LineFormattingOptions in ExtractMethodGenerationOptions

* DocumentFormattingOptions

* Move a couple of options from IdeCodeStyle to SyntaxFormatting to make them available to new document formatter

* Generalize using placement option in AddImportPlacementOptions

* Move PreferParameterNullChecking and AllowEmbeddedStatementsOnSameLine to CSharpSimplifierOptions

* Move CodeGen options to compiler extensions

* UseExpressionBody

* Eliminate more calls to Document.GetOptionsAsync

* Cleanup DocumentationCommentOptions

* Line formatting options

* DefaultConditionalExpressionWrappingLength

* insert_final_newline

* Add PreferThrowExpression to simplifier options

* Add AddNullChecksToConstructorsGeneratedFromMembers to CodeGenOptions

* GenerateEqualsAndGetHashCodeFromMembersOptions

* IImplementInterfaceService

* AddParameterCheckCodeRefactoringProvider

* ReplaceMethodWithPropertyService

* NamingStylePreferences

* Eliminate legacy option helpers

* Fix up ExtractMethod options

* Remove SyntaxFormattingOptions ctors

* Replace extra helpers with CodeFixOptionsProvider

* PreferUtf8StringLiterals

* RazorLineFormattingOptionsStorage

* Remove usage of Document.GetOptionsAsync - 1

* Remove internal usage of DocumentOptionSet and Document.GetOptionsAsync

* Simplify and unify option definition patterns

* Fixes and pattern unification

* Serialization and equality

* Simplify

* Rename

* Fixes

* CompletionOption fixes

* Feedback

* Single switch

* Add frozen delegate tests

* Add extract method test

* Add workitem

* Fix

* Add support for CompilerFeatureRequiredAttribute (#61113)

Adds support for decoding and reporting errors when `CompilerFeatureRequiredAttribute` is encountered on metadata type symbols. We also block applying the attribute by hand in both C# and VB.

* Delegate keyword tests

* Verifying interpolation escaping of curlies in content (#61387)

* Verify classification on var pattern (#61376)

* Add lambda parameters in scope in nameof using proper binder (#61382)

* Parse `unchecked` gracefully in operators (#61309)

* Update src/Features/Core/Portable/InheritanceMargin/AbstractInheritanceMarginService_Helpers.cs

* Update src/Features/Core/Portable/InheritanceMargin/AbstractInheritanceMarginService_Helpers.cs

* Use AspNetCoreKey to external access assembly

* Fix typo (#61380)

* Add new collapsing option for metadata files that contain source (#61205)

* More correctly respect background analysis scope (#61392)

* Fix function id (#61400)

* Wait for async operations to complete before proceeding

* Update SDK to .NET 7 Preview 4

* Avoid logging work when no logger is specified

* Emit CompilerFeatureRequired for ref structs when present.

* Support emitting CompilerFeatureRequiredAttribute for contructors of types with required members.

* [LSP] Small cleanup for pull diagnostics logging (#61417)

* Small logging cleanup on pull diagnostics code

* Update tests to account for lsp diagnostics throwing when mismatch in diagnostic mode

* Address feedback from numeric IntPtr feature review (#61418)

* Fix binding for checkbox text in rename dialogs (#61430)

Previously text was bound to properties on the control type using x:Name. This restores that

* Fix build

* Restrict IsGenericConstraintContext for C#

* More instrumentation for ReferenceCachingCS (#61402)

* Do not filter snippets

* Reverted delegate completion

* Allow source link, embedded or decompiled source in Peek Definition (#61427)

* Update status for DIM and numeric IntPtr (#61464)

* Lazily produce semantic models in source generators

* Remove unnecessary finalizer state handling from MethodToStateMachineRewriter (#61409)

* Update src/Tools/IdeCoreBenchmarks/IncrementalSourceGeneratorBenchmarks.cs

* Update src/Tools/IdeCoreBenchmarks/IncrementalSourceGeneratorBenchmarks.cs

* Update src/Tools/IdeCoreBenchmarks/IncrementalSourceGeneratorBenchmarks.cs

* lint

* Address prototype comments (#61436)

* Give a warning when obsolete is applied to a required member and the containing context is not obsolete, or all constructors are not obsolete/setsrequiredmembers.

* Restore nullable constructor warnings for constructors with `SetsRequiredMembersAttribute`.

* Remove prototype comments.

* Add tests and extra state

* Extract checking for generic constraint context to extension method & minor refactoring

* Update test comment

* Generate single OptProf config for compiler vsix

Currently OptProf can't support profiling for multiple flavors of vsix, and Optprof test only runs on X64. Multiple configs with same profiling binary are causing the tests to fail.

* Reduce release/64 limit for EndToEndTests.Constraints (#61480)

* Reduce release/64 limit for EndToEndTests.Constraints

* Lower bar more

* Lower bar more

* Remove parameter nullchecking feature (#61397)

* Fix null ref for JS files (#61472)

* Add file paths to interactive buffers and documents to support LSP requests (#61441)

* Add file paths to interactive buffers and documents to support LSP requests

* Switch to false returning predicate

* more feedback

* mroe feedback

* Reword comment

* Log additional information from CopyRefAssembly (#61384)

* update versioning to use languageserver.client.implementation

* Require VS 17.0 in signed build.

* Bump LSP protocol version (#61494)

* Bump protocol version

* React to breaking changes in foldingrangekind

* Disable inheritance margin for interactive documents (#61476)

* fix

* Improvements to the background compiler component

* add docs

* Simplify

* docs

* Check token

* Simplify

* Simplify

* Rename enum field

* Lifted relational operator implies operands non-null when true (#61403)

* Use ImmutableArray instead of IEnumerable parameters

* Use assignabiilty instead of subclass test in extension loader

* Fix test

* Fix test

* Simplify rename implementation

* Rename

* Unify all end operations that rename performs

* restore code

* Remove unnecessary code'

* Unify error handling in rename

* Add comment

* message severities

* Restore

* Simplify

* Bring main-vs-deps back (#61514)

* Add main-vs-deps back

* Update eng/config/PublishData.json

Co-authored-by: Joey Robichaud <joseph.robichaud@microsoft.com>

Co-authored-by: Joey Robichaud <joseph.robichaud@microsoft.com>

* Simplify LSP reference update

* Adjust conversion from nuint to float/double (#61345)

* Add embedded classification for field initializers

* Add support for properties

* Update src/EditorFeatures/Core/InlineRename/InlineRenameSession.cs

* Update src/EditorFeatures/Core/RenameTracking/RenameTrackingTaggerProvider.RenameTrackingCommitter.cs

* Update src/EditorFeatures/Core/RenameTracking/RenameTrackingTaggerProvider.RenameTrackingCommitter.cs

* Fix setup authoring bug (#61508)

* Expose VirtualChars to asp.net (through EA) to facilitate route classification

* add docs

* Add member

* NRT

* Make async

* Make async

* Pull token out

* Use feature attribute

* Remove Utf8StringLiteral conversion (#61481)

https://github.com/dotnet/csharplang/blob/main/meetings/2022/LDM-2022-04-18.md#target-typing-a-regular-string-literal-to-utf8-types

* Fix AbstractLanguageService constructor (#61513)

* Fix AbstractLanguageService constructor

* Fix formatting

* Don't throw in logging when the document path contains curly braces (#61524)

* Update unit tests

* Improve normalization to match idiomatic patterns for nested usings and fixed statements. (#61533)

* Better syntax normalization for fixed/using statements

* Add tests

* Prepare VB iterators for EnC support (#61488)

* Remove unused parameters

* Separate iterator finalizer states from resumable states.

* Remove unused

* Skip timing test (#61222)

* Skip test

* Add some APIs on AspNetCoreVirtualCharSequence

* Add IsDefault

* Final prototype comments and top level statements local adjustments (#61551)

Clean up the last of the prototype comments and adjust the parsing of locals named required in top level statements.

* IDE Support for Required Members (#61440)

* Add required keyword recommender.

* Add SyntaxNormalizer test.

* Code generation support.

* Add SymbolDisplay

* F1 help service and test fix.

* Add order modifier tests and update.

* Change natural type of UTF-8 string literals to `ReadOnlySpan<byte>` and null terminate the underlying blob. (#61532)

https://github.com/dotnet/csharplang/blob/main/meetings/2022/LDM-2022-04-18.md#natural-type-of-utf8-literals
https://github.com/dotnet/csharplang/blob/main/meetings/2022/LDM-2022-04-18.md#should-utf8-literals-be-null-terminated

Related to #61517
Closes #60644

* fix assumption of length

* Bind native integers in cref (#61431)

* Use VS2022 for PR Validation builds

* PR feedback

* Add unit test project IVT to ExternalAccess.AspNetCore

* Fix generation location when generating across files

* Add test

* Relax check

* EnC: Allow adding/removing await expressions and yield statements (#61356)

* Implements support for adding and removing await/yield return in C# async, iterator and async iterator methods.

* Fix syntax node associated with BoundTryStatement created from using syntax

* Update required members status (#61602)

* Implements support for adding and removing await/yield return in C# in the IDE (#61521)

Co-authored-by: Sam Harwell <Sam.Harwell@microsoft.com>
Co-authored-by: Julien Couvreur <jcouv@users.noreply.github.com>
Co-authored-by: Chris Sienkiewicz <chsienki@microsoft.com>
Co-authored-by: DoctorKrolic <mapmyp03@gmail.com>
Co-authored-by: Gen Lu <genlu@users.noreply.github.com>
Co-authored-by: DoctorKrolic <70431552+DoctorKrolic@users.noreply.github.com>
Co-authored-by: Cyrus Najmabadi <cyrusn@microsoft.com>
Co-authored-by: gel@microsoft.com <gel@microsoft.com>
Co-authored-by: CyrusNajmabadi <cyrus.najmabadi@gmail.com>
Co-authored-by: dotnet bot <dotnet-bot@dotnetfoundation.org>
Co-authored-by: AlFas <AlFasGD@users.noreply.github.com>
Co-authored-by: Ramkumar Ramesh <ramkumar.ramesh.8@live.com>
Co-authored-by: Ramkumar Ramesh <ramram@microsoft.com>
Co-authored-by: AlekseyTs <AlekseyTs@users.noreply.github.com>
Co-authored-by: Allison Chou <allichou@microsoft.com>
Co-authored-by: Tomáš Matoušek <tmat@users.noreply.github.com>
Co-authored-by: David Wengier <david.wengier@microsoft.com>
Co-authored-by: David Barbet <dabarbet@microsoft.com>
Co-authored-by: Fred Silberberg <frsilb@microsoft.com>
Co-authored-by: James Newton-King <james@newtonking.com>
Co-authored-by: Weihan Li <weihanli@outlook.com>
Co-authored-by: Joey Robichaud <joseph.robichaud@microsoft.com>
Co-authored-by: Julien Couvreur <julien.couvreur@gmail.com>
Co-authored-by: Andrew Hall <ryzngard@live.com>
Co-authored-by: Manish Vasani <mavasani@microsoft.com>
Co-authored-by: Jared Parsons <jaredpparsons@gmail.com>
Co-authored-by: Joey Robichaud <jorobich@microsoft.com>
Co-authored-by: Rikki Gibson <rigibson@microsoft.com>
Co-authored-by: akhera99 <ankitakhera@microsoft.com>
Co-authored-by: Ankita Khera <40616383+akhera99@users.noreply.github.com>
  • Loading branch information
1 parent 95c69ea commit 63fb830
Show file tree
Hide file tree
Showing 2,593 changed files with 116,731 additions and 38,426 deletions.
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@ dotnet_diagnostic.IDE0043.severity = warning
# IDE0044: Make field readonly
dotnet_diagnostic.IDE0044.severity = warning

# IDE0170: Prefer extended property pattern
dotnet_diagnostic.IDE0170.severity = warning

# RS0016: Only enable if API files are present
dotnet_public_api_analyzer.require_api_files = true

Expand Down Expand Up @@ -211,6 +214,7 @@ csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
csharp_style_inlined_variable_declaration = true:suggestion
csharp_style_throw_expression = true:suggestion
csharp_style_conditional_delegate_call = true:suggestion
csharp_style_prefer_extended_property_pattern = true:suggestion

# Space preferences
csharp_space_after_cast = false
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
[Dd]ebug/
[Rr]elease/
[Bb]inaries/
x64/
[Bb]in/
[Oo]bj/
.dotnet/
Expand Down
2 changes: 1 addition & 1 deletion Compilers.sln
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.Pack
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BuildBoss", "src\Tools\BuildBoss\BuildBoss.csproj", "{8A02AFAF-F622-4E3E-9E1A-8CFDACC7C7E1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Net.Compilers.Toolset.Package", "src\NuGet\Microsoft.Net.Compilers.Toolset\Microsoft.Net.Compilers.Toolset.Package.csproj", "{6D407402-CC4A-4125-9B00-C70562A636A5}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Net.Compilers.Toolset.Package", "src\NuGet\Microsoft.Net.Compilers.Toolset\AnyCpu\Microsoft.Net.Compilers.Toolset.Package.csproj", "{6D407402-CC4A-4125-9B00-C70562A636A5}"
EndProject
Project("{778DAE3C-4631-46EA-AA77-85C1314464D9}") = "vbi", "src\Interactive\vbi\vbi.vbproj", "{706CFC25-B6E0-4DAA-BCC4-F6FAAFEEDF87}"
EndProject
Expand Down
214 changes: 121 additions & 93 deletions Roslyn.sln

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion azure-pipelines-pr-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ stages:
timeoutInMinutes: 360
# Conditionally set build pool so we can share this YAML when building with different pipeline
pool:
name: VSEngSS-MicroBuild2019-1ES
name: VSEngSS-MicroBuild2022-1ES
demands:
- msbuild
- visualstudio
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines-richnav.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
demands: ImageOverride -equals Build.Windows.Amd64.VS2022.Pre.Open
variables:
EnableRichCodeNavigation: true
timeoutInMinutes: 200
timeoutInMinutes: 260

steps:
- task: PowerShell@2
Expand Down
13 changes: 7 additions & 6 deletions docs/Language Feature Status.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,30 @@ efforts behind them.

| Feature | Branch | State | Developer | Reviewer | LDM Champ |
| ------- | ------ | ----- | --------- | -------- | --------- |
| [DIM for Static Members](https://github.com/dotnet/csharplang/issues/4436) | [DefaultInterfaceImplementation](https://github.com/dotnet/roslyn/tree/features/DefaultInterfaceImplementation) | [Merged into 17.3p2](https://github.com/dotnet/roslyn/issues/60968) | [AlekseyTs](https://github.com/AlekseyTs) | [333fred](https://github.com/333fred), [jcouv](https://github.com/jcouv) | [MadsTorgersen](https://github.com/MadsTorgersen) |
| [Numeric IntPtr](https://github.com/dotnet/csharplang/issues/6065) | [numeric-intptr](https://github.com/dotnet/roslyn/tree/features/numeric-intptr) | [Merged into 17.3p2](https://github.com/dotnet/roslyn/issues/60578) | [jcouv](https://github.com/jcouv) | [cston](https://github.com/cston), [333fred](https://github.com/333fred) | [jcouv](https://github.com/jcouv) |
| [Unsigned Right Shift](https://github.com/dotnet/csharplang/issues/4682) | [UnsignedRightShift](https://github.com/dotnet/roslyn/tree/features/UnsignedRightShift) | [Merged into 17.3p1](https://github.com/dotnet/roslyn/issues/60433) | [AlekseyTs](https://github.com/AlekseyTs) | [333fred](https://github.com/333fred), [jcouv](https://github.com/jcouv) | [AlekseyTs](https://github.com/AlekseyTs) |
| [Utf8 String Literals](https://github.com/dotnet/csharplang/issues/184) | [Utf8StringLiterals](https://github.com/dotnet/roslyn/tree/features/Utf8StringLiterals) | [Merged into 17.3p1](https://github.com/dotnet/roslyn/issues/58848) | [AlekseyTs](https://github.com/AlekseyTs) | [cston](https://github.com/cston), [RikkiGibson](https://github.com/RikkiGibson) | [MadsTorgersen](https://github.com/MadsTorgersen) |
| [Pattern matching on `ReadOnlySpan<char>`](https://github.com/dotnet/csharplang/issues/1881) | [patterns-span-char](https://github.com/dotnet/roslyn/tree/features/patterns-span-char) | [Merged into 17.3p1](https://github.com/dotnet/roslyn/issues/59191) | [YairHalberstadt ](https://github.com/YairHalberstadt) | [cston](https://github.com/cston), [RikkiGibson](https://github.com/RikkiGibson) | [jcouv](https://github.com/jcouv) |
| [Checked Operators](https://github.com/dotnet/csharplang/issues/4665) | [CheckedUserDefinedOperators](https://github.com/dotnet/roslyn/tree/features/CheckedUserDefinedOperators) | [Merged into 17.3p1](https://github.com/dotnet/roslyn/issues/59458) | [AlekseyTs](https://github.com/AlekseyTs) | [333fred](https://github.com/333fred), [chsienki](https://github.com/chsienki) | [AlekseyTs](https://github.com/AlekseyTs) |
| [auto-default structs](https://github.com/dotnet/csharplang/issues/5737) | main | [Merged into 17.3p1](https://github.com/dotnet/roslyn/issues/60167) | [RikkiGibson](https://github.com/RikkiGibson) | [cston](https://github.com/cston), [jcouv](https://github.com/jcouv) |
| [Newlines in interpolations](https://github.com/dotnet/csharplang/issues/4935) | main | [Merged in 17.1p1](https://github.com/dotnet/roslyn/issues/57154) | [CyrusNajmabadi](https://github.com/CyrusNajmabadi) | [jcouv](https://github.com/jcouv), [chsienki](https://github.com/chsienki) | [CyrusNajmabadi](https://github.com/CyrusNajmabadi) |
| [List patterns](https://github.com/dotnet/csharplang/issues/3435) | [list-patterns](https://github.com/dotnet/roslyn/tree/features/list-patterns) | [Merged in 17.1p2](https://github.com/dotnet/roslyn/issues/51289) | [alrz](https://github.com/alrz) | [jcouv](https://github.com/jcouv), [333fred](https://github.com/333fred) | [333fred](https://github.com/333fred) |
| [Parameter null-checking](https://github.com/dotnet/csharplang/issues/2145) | [param-nullchecking](https://github.com/dotnet/roslyn/tree/features/param-nullchecking) | [Merged in 17.1p3](https://github.com/dotnet/roslyn/issues/36024) | [RikkiGibson](https://github.com/RikkiGibson), [fayrose](https://github.com/fayrose) | [cston](https://github.com/cston), [chsienki](https://github.com/chsienki) | [jaredpar](https://github.com/jaredpar) |
| [Raw string literals](https://github.com/dotnet/csharplang/issues/4304) | [RawStringLiterals](https://github.com/dotnet/roslyn/tree/features/RawStringLiterals) | [Merged into 17.2](https://github.com/dotnet/roslyn/issues/55306) | [CyrusNajmabadi](https://github.com/CyrusNajmabadi) | [jcouv](https://github.com/jcouv) | [CyrusNajmabadi](https://github.com/CyrusNajmabadi) |
| [Cache delegates for static method group](https://github.com/dotnet/roslyn/issues/5835) | main | [Merged into 17.2](https://github.com/dotnet/roslyn/pull/58288) | [pawchen](https://github.com/pawchen) | [AlekseyTs](https://github.com/AlekseyTs), [jcouv](https://github.com/jcouv) | [AlekseyTs](https://github.com/AlekseyTs) |
| [nameof(parameter)](https://github.com/dotnet/csharplang/issues/373) | main | [In Progress](https://github.com/dotnet/roslyn/issues/40524) | [jcouv](https://github.com/jcouv) | TBD | [jcouv](https://github.com/jcouv) |
| [nameof(parameter)](https://github.com/dotnet/csharplang/issues/373) | main | [Merged into 17.3p2](https://github.com/dotnet/roslyn/issues/40524) | [jcouv](https://github.com/jcouv) | [AlekseyTs](https://github.com/AlekseyTs), [RikkiGibson](https://github.com/RikkiGibson) | [jcouv](https://github.com/jcouv) |
| [Relaxing Shift Operator](https://github.com/dotnet/csharplang/issues/4666) | main | [Merged into 17.3p2](https://github.com/dotnet/roslyn/issues/60967) | [AlekseyTs](https://github.com/AlekseyTs) | [333fred](https://github.com/333fred), [jcouv](https://github.com/jcouv) | [MadsTorgersen](https://github.com/MadsTorgersen) |
| [Relax ordering of `ref` and `partial` modifiers](https://github.com/dotnet/csharplang/issues/946) | [ref-partial](https://github.com/dotnet/roslyn/tree/features/ref-partial) | In Progress | [alrz](https://github.com/alrz) | [gafter](https://github.com/gafter) | [jcouv](https://github.com/jcouv) |
| [Generic attributes](https://github.com/dotnet/csharplang/issues/124) | [generic-attributes](https://github.com/dotnet/roslyn/tree/features/generic-attributes) | [Merged into 17.0p4 (preview langver)](https://github.com/dotnet/roslyn/issues/36285) | [AviAvni](https://github.com/AviAvni) | [RikkiGibson](https://github.com/RikkiGibson), [jcouv](https://github.com/jcouv) | [mattwar](https://github.com/mattwar) |
| [Default in deconstruction](https://github.com/dotnet/roslyn/pull/25562) | [decon-default](https://github.com/dotnet/roslyn/tree/features/decon-default) | [Implemented](https://github.com/dotnet/roslyn/issues/25559) | [jcouv](https://github.com/jcouv) | [gafter](https://github.com/gafter) | [jcouv](https://github.com/jcouv) |
| [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) |
| [Required members](https://github.com/dotnet/csharplang/issues/3630) | [required-members](https://github.com/dotnet/roslyn/tree/features/required-members) | [In Progress](https://github.com/dotnet/roslyn/issues/57046) | [333fred](https://github.com/333fred) | [jcouv](https://github.com/jcouv), [RikkiGibson](https://github.com/RikkiGibson) | [333fred](https://github.com/333fred) |
| [Required members](https://github.com/dotnet/csharplang/issues/3630) | main | [Merged into 17.3p2](https://github.com/dotnet/roslyn/issues/57046) | [333fred](https://github.com/333fred) | [jcouv](https://github.com/jcouv), [RikkiGibson](https://github.com/RikkiGibson) | [333fred](https://github.com/333fred) |
| [Top Level statement attribute specifiers](https://github.com/dotnet/csharplang/issues/5045) | [main-attributes](https://github.com/dotnet/roslyn/tree/features/main-attributes) | [In Progress](https://github.com/dotnet/roslyn/issues/57047) | [chsienki](https://github.com/chsienki) | [cston](https://github.com/cston), [333fred](https://github.com/333fred) | [jaredpar](https://github.com/jaredpar) |
| [Primary Constructors](https://github.com/dotnet/csharplang/issues/2691) | [primary-constructors](https://github.com/dotnet/roslyn/tree/features/primary-constructors) | [In Progress](https://github.com/dotnet/roslyn/issues/57048) | TBD | TBD | [MadsTorgersen](https://github.com/MadsTorgersen) |
| [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) |
| [Pattern matching on `ReadOnlySpan<char>`](https://github.com/dotnet/csharplang/issues/1881) | [patterns-span-char](https://github.com/dotnet/roslyn/tree/features/patterns-span-char) | [Merged into 17.3p1](https://github.com/dotnet/roslyn/issues/59191) | [YairHalberstadt ](https://github.com/YairHalberstadt) | [cston](https://github.com/cston), [RikkiGibson](https://github.com/RikkiGibson) | [jcouv](https://github.com/jcouv) |
| [nameof accessing instance members](https://github.com/dotnet/roslyn/issues/40229) | main | [In Progress](https://github.com/dotnet/roslyn/pull/48754) | [YairHalberstadt ](https://github.com/YairHalberstadt) | [333fred](https://github.com/333fred), [AlekseyTs](https://github.com/AlekseyTs) | [333fred](https://github.com/333fred) |
| [ref fields](https://github.com/dotnet/csharplang/blob/main/proposals/low-level-struct-improvements.md) | [ref-fields](https://github.com/dotnet/roslyn/tree/features/ref-fields) | [In Progress](https://github.com/dotnet/roslyn/issues/59194) | [cston](https://github.com/cston) | [RikkiGibson](https://github.com/RikkiGibson), [AlekseyTs](https://github.com/AlekseyTs) | [jaredpar](https://github.com/jaredpar) |
| Numeric IntPtr | [numeric-intptr](https://github.com/dotnet/roslyn/tree/features/numeric-intptr) | [In Progress](https://github.com/dotnet/roslyn/issues/60578) | [jcouv](https://github.com/jcouv) | TBD | [jcouv](https://github.com/jcouv) |
| [File types](https://github.com/dotnet/csharplang/issues/6011) | [file-types](https://github.com/dotnet/roslyn/tree/features/file-types) | [In Progress](https://github.com/dotnet/roslyn/issues/60819) | [RikkiGibson](https://github.com/RikkiGibson) | [333fred](https://github.com/333fred), [cston](https://github.com/cston) | [stephentoub](https://github.com/stephentoub) |
| [File types](https://github.com/dotnet/csharplang/issues/6011) | [file-types](https://github.com/dotnet/roslyn/tree/features/file-types) | [In Progress](https://github.com/dotnet/roslyn/issues/60819) | [RikkiGibson](https://github.com/RikkiGibson) | [jcouv](https://github.com/jcouv), [cston](https://github.com/cston) | [stephentoub](https://github.com/stephentoub) |

# C# 10.0

Expand Down
45 changes: 45 additions & 0 deletions docs/TestAccessor Pattern.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# The `TestAccessor` Pattern

The `TestAccessor` pattern allows production code to expose internal functionality for test purposes without making the internal functionality available to other production code. The pattern has two primary components:

1. A `TestAccessor` type, which contains the functionality available only for testing
2. A `GetTestAccessor()` method, which returns an instance of `TestAccessor`

The pattern relies on enforcement of a simple rule that no production code is allowed to call a `GetTestAccessor()` method. This is enforceable either through code reviews or through an analyzer. This pattern has many advantages over alternatives:

* The pattern does not require expanded accessibility (e.g. `internal` instead of `private`) for the purpose of testing
* The pattern is self-documenting: all properties and methods within a `TestAccessor` type are intended only for use in test code
* The pattern is consistent enough to enforce through static analysis (analyzers)
* The pattern is simple enough to enforce manually (code reviews)

## The `TestAccessor` Type

The `TestAccessor` type is typically defined as a nested structure. In the following example, the `SomeProductionType.TestAccessor.PrivateStateData` property allows test code to read and write the value of the private field `SomeProductionType._privateStateData` without exposing the `_privateStateData` field to other production code.

```csharp
internal class SomeProductionType
{
private int _privateStateData;

internal readonly struct TestAccessor
{
private readonly SomeProductionType _instance;

internal TestAccessor(SomeProductionType instance)
{
_instance = instance;
}

internal ref int PrivateStateData => ref _instance._privateStateData;
}
}
```

## The `GetTestAccessor()` Method

The `GetTestAccessor()` method is always defined as follows:

```csharp
internal TestAccessor GetTestAccessor()
=> new TestAccessor(this);
```
6 changes: 3 additions & 3 deletions docs/analyzers/Analyzer Samples.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ Analyzers have been broadly categorized into the following three buckets based o
**Contents:**

Following sample analyzers, with simple unit tests, are provided:
1. Stateless analyzers:
1. [Stateless analyzers](https://github.com/dotnet/roslyn-sdk/tree/master/samples/CSharp/Analyzers/Analyzers.Implementation/StatelessAnalyzers):
1. SymbolAnalyzer: Analyzer for reporting symbol diagnostics.
2. SyntaxNodeAnalyzer: Analyzer for reporting syntax node diagnostics.
3. CodeBlockAnalyzer: Analyzer for reporting code block diagnostics.
4. CompilationAnalyzer: Analyzer for reporting compilation diagnostics.
5. SyntaxTreeAnalyzer: Analyzer for reporting syntax tree diagnostics.
6. SemanticModelAnalyzer: Analyzer for reporting syntax tree diagnostics, that require some semantic analysis.
2. Stateful analyzers:
2. [Stateful analyzers](https://github.com/dotnet/roslyn-sdk/tree/master/samples/CSharp/Analyzers/Analyzers.Implementation/StatefulAnalyzers):
1. CodeBlockStartedAnalyzer: Analyzer to demonstrate code block wide analysis.
2. CompilationStartedAnalyzer: Analyzer to demonstrate analysis within a compilation, for example analysis that depends on certain well-known symbol(s).
3. CompilationStartedAnalyzerWithCompilationWideAnalysis: Analyzer to demonstrate compilation-wide analysis.
3. Additional File analyzers:
3. [Additional File analyzers](https://github.com/dotnet/roslyn-sdk/tree/master/samples/CSharp/Analyzers/Analyzers.Implementation/AdditionalFileAnalyzers):
1. SimpleAdditionalFileAnalyzer: Demonstrates reading an additional file line-by-line and using the data in analysis.
2. XmlAdditionalFileAnalyzer: Demonstrates writing an additional file out to a `Stream` so that it can be read back as a structured document (in this case, XML).
Loading

0 comments on commit 63fb830

Please sign in to comment.