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

Add Collection expressions to the language reference #36782

Merged
merged 13 commits into from
Aug 31, 2023

Conversation

BillWagner
Copy link
Member

@BillWagner BillWagner commented Aug 22, 2023

Contributes to #36356

This PR has the tasks from the #36356 (comment)

Reorganize some of the content: Move the collections and arrays content from the programming guide to the language reference. Consolidate the articles on arrays into a single article. Then update the consolidated article by moving snippets and updating the samples.

Fix existing issues: Edit pass on collections article. Simplify examples and remove outdated examples. Update text. Instead of listing all collections, refer to articles in the .NET fundamentals and API reference where all collections are listed.

Fixes #20541: Don't list all collection types. That's brittle. Instead, refer to locations in the standard section, and the API reference where all collections can be found for the current version.

Edit pass on arrays article. Simplify and combine many of the samples. Update the related text. Update the samples and the text to match our current style.

Fixes #27181: Rewrite the text that describes the default value for any array elements.
Fixes #29181: Specify that 2 D arrays can be thought of as [row, column].

Add collection expressions article: This is the new article that covers collection expressions.

Internal previews for significant changes:

Other files changed are for updated links.


Internal previews

Toggle expand/collapse
📄 File 🔗 Preview link
docs/csharp/advanced-topics/expression-trees/index.md Expression Trees
docs/csharp/language-reference/builtin-types/arrays.md docs/csharp/language-reference/builtin-types/arrays
docs/csharp/language-reference/builtin-types/collections.md docs/csharp/language-reference/builtin-types/collections
docs/csharp/language-reference/operators/collection-expressions.md docs/csharp/language-reference/operators/collection-expressions
docs/csharp/language-reference/operators/member-access-operators.md Member access operators and expressions - the dot, indexer, and invocation operators.
docs/csharp/language-reference/operators/new-operator.md "new operator - Create and initialize a new instance of a type"
docs/csharp/language-reference/statements/iteration-statements.md Iteration statements - for, foreach, do, and while
docs/csharp/programming-guide/classes-and-structs/how-to-use-implicitly-typed-local-variables-and-arrays-in-a-query-expression.md docs/csharp/programming-guide/classes-and-structs/how-to-use-implicitly-typed-local-variables-and-arrays-in-a-query-expression
docs/csharp/programming-guide/classes-and-structs/implicitly-typed-local-variables.md Implicitly typed local variables (C# Programming Guide)
docs/csharp/programming-guide/concepts/index.md "Programming Concepts (C#)"
docs/csharp/programming-guide/concepts/iterators.md Iterators (C#)
docs/csharp/programming-guide/generics/generics-and-arrays.md Generics and Arrays (C# Programming Guide)
docs/csharp/programming-guide/index.md C# programming guide
docs/csharp/tour-of-csharp/features.md docs/csharp/tour-of-csharp/features
docs/csharp/tour-of-csharp/index.md A tour of the C# language
docs/csharp/whats-new/csharp-12.md What's new in C# 12 - C# Guide
docs/fundamentals/code-analysis/quality-rules/ca1814.md CA1814: Prefer jagged arrays over multidimensional
docs/standard/serialization/system-text-json/supported-collection-types.md docs/standard/serialization/system-text-json/supported-collection-types

@BillWagner BillWagner marked this pull request as ready for review August 28, 2023 20:13
.openpublishing.redirection.csharp.json Outdated Show resolved Hide resolved
docs/csharp/language-reference/builtin-types/arrays.md Outdated Show resolved Hide resolved
docs/csharp/language-reference/builtin-types/arrays.md Outdated Show resolved Hide resolved
docs/csharp/language-reference/builtin-types/arrays.md Outdated Show resolved Hide resolved
docs/csharp/language-reference/builtin-types/arrays.md Outdated Show resolved Hide resolved
@gewarren
Copy link
Contributor

gewarren commented Aug 31, 2023

One other thing - there's no default titleSuffix for the /csharp folder. Might make sense to add a default title suffix of "C#"?

image

BillWagner and others added 10 commits August 31, 2023 15:11
Move programming guide articles on arrays and collections into the language reference section. This set of content will be updated and edited, then collection expressions will be added.
Move all array content into the language reference.
Move snippets to the language reference location.
Run cleanrepo to update redirected links with the new target, and replace absolute links with relative links.
Fix open issues on the collection articles, and perform an edit pass to update.

Simplify examples and remove outdated examples. Update text. Instead of listing all collections, refer to articles in the .NET fundamentals and API reference where all collections are listed.
Edit and update the Arrays article. Remove older outdated samples, update style (both text and code), and fix two open issues:

- Fix dotnet#27181 Clarify the default value for array elements.
- Fix dotnet#29181 Clarify the row, column for a 2D array.
Do a grammar check on the new article, fix build warnings, and add links.
The language reference and spec titles were duplicated
Co-authored-by: Genevieve Warren <24882762+gewarren@users.noreply.github.com>
@BillWagner BillWagner force-pushed the collection-expression-reference branch from 91da92a to 67afb33 Compare August 31, 2023 19:20
@BillWagner BillWagner enabled auto-merge (squash) August 31, 2023 20:43
Move snippets.
@BillWagner BillWagner merged commit b8f805b into dotnet:main Aug 31, 2023
8 checks passed
@BillWagner BillWagner deleted the collection-expression-reference branch August 31, 2023 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants