Skip to content

Commit 19c19ec

Browse files
committed
Merge remote-tracking branch 'origin/master' into m
2 parents 2ca0209 + 88bd81b commit 19c19ec

File tree

15,695 files changed

+975950
-608600
lines changed

Some content is hidden

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

15,695 files changed

+975950
-608600
lines changed

.editorconfig

Lines changed: 63 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,15 @@ indent_size = 2
3535
end_of_line = lf
3636
indent_size = 2
3737

38-
# Dotnet diagnostic settings
39-
[*.{cs,vb}]
40-
dotnet_diagnostic.xUnit2018.severity = none # "do not compare an object's exact type to the abstract class" is a valid assert, but very noisy right now
41-
4238
# Dotnet code style settings:
4339
[*.{cs,vb}]
40+
41+
# IDE0055: Fix formatting
42+
dotnet_diagnostic.IDE0055.severity = warning
43+
4444
# Sort using and Import directives with System.* appearing first
4545
dotnet_sort_system_directives_first = true
46+
dotnet_separate_import_directive_groups = false
4647
# Avoid "this." and "Me." if not necessary
4748
dotnet_style_qualification_for_field = false:refactoring
4849
dotnet_style_qualification_for_property = false:refactoring
@@ -140,6 +141,13 @@ dotnet_naming_symbols.all_members.applicable_kinds = *
140141

141142
dotnet_naming_style.pascal_case_style.capitalization = pascal_case
142143

144+
# error RS2008: Enable analyzer release tracking for the analyzer project containing rule '{0}'
145+
dotnet_diagnostic.RS2008.severity = none
146+
147+
# IDE0073: File header
148+
dotnet_diagnostic.IDE0073.severity = warning
149+
file_header_template = Licensed to the .NET Foundation under one or more agreements.\nThe .NET Foundation licenses this file to you under the MIT license.\nSee the LICENSE file in the project root for more information.
150+
143151
# CSharp code style settings:
144152
[*.cs]
145153
# Newline settings
@@ -209,3 +217,54 @@ csharp_space_between_square_brackets = false
209217
csharp_prefer_braces = true:silent
210218
csharp_preserve_single_line_blocks = true
211219
csharp_preserve_single_line_statements = true
220+
221+
# warning RS0037: PublicAPI.txt is missing '#nullable enable'
222+
dotnet_diagnostic.RS0037.severity = none
223+
224+
[src/CodeStyle/**.{cs,vb}]
225+
# warning RS0005: Do not use generic CodeAction.Create to create CodeAction
226+
dotnet_diagnostic.RS0005.severity = none
227+
228+
[src/{Analyzers,CodeStyle,Features,Workspaces,EditorFeatures}/**/*.{cs,vb}]
229+
230+
# IDE0011: Add braces
231+
csharp_prefer_braces = when_multiline:warning
232+
# NOTE: We need the below severity entry for Add Braces due to https://github.com/dotnet/roslyn/issues/44201
233+
dotnet_diagnostic.IDE0011.severity = warning
234+
235+
# IDE0035: Remove unreachable code
236+
dotnet_diagnostic.IDE0035.severity = warning
237+
238+
# IDE0036: Order modifiers
239+
dotnet_diagnostic.IDE0036.severity = warning
240+
241+
# IDE0040: Add accessibility modifiers
242+
dotnet_diagnostic.IDE0040.severity = warning
243+
244+
# IDE0043: Format string contains invalid placeholder
245+
dotnet_diagnostic.IDE0043.severity = warning
246+
247+
# IDE0044: Make field readonly
248+
dotnet_diagnostic.IDE0044.severity = warning
249+
250+
# CONSIDER: Are IDE0051 and IDE0052 too noisy to be warnings for IDE editing scenarios? Should they be made build-only warnings?
251+
# IDE0051: Remove unused private member
252+
dotnet_diagnostic.IDE0051.severity = warning
253+
254+
# IDE0052: Remove unread private member
255+
dotnet_diagnostic.IDE0052.severity = warning
256+
257+
# IDE0059: Unnecessary assignment to a value
258+
dotnet_diagnostic.IDE0059.severity = warning
259+
260+
# IDE0060: Remove unused parameter
261+
dotnet_diagnostic.IDE0060.severity = warning
262+
263+
# CA1822: Make member static
264+
dotnet_diagnostic.CA1822.severity = warning
265+
266+
# Prefer "var" everywhere
267+
dotnet_diagnostic.IDE0007.severity = warning
268+
csharp_style_var_for_built_in_types = true:warning
269+
csharp_style_var_when_type_is_apparent = true:warning
270+
csharp_style_var_elsewhere = true:warning

.github/CODEOWNERS

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,28 @@
11
# Automatically request reviews when a pull request changes any owned files
22
# More information: https://github.com/blog/2392-introducing-code-owners
33

4-
*.groovy @dotnet/roslyn-infrastructure
4+
*.yml @dotnet/roslyn-infrastructure
55
.github/ @dotnet/roslyn-infrastructure
6-
build/ @dotnet/roslyn-infrastructure
6+
eng/ @dotnet/roslyn-infrastructure
7+
scripts/ @dotnet/roslyn-infrastructure
8+
79
src/CodeStyle/ @dotnet/roslyn-ide
810
src/Compilers/ @dotnet/roslyn-compiler
911
src/EditorFeatures/ @dotnet/roslyn-ide
12+
13+
# If we touch the WPF layer, let the VS for Mac team have an opportunity to sign-off. Any changes made here
14+
# may also have to be reflected into the EditorFeatures.Cocoa library which doesn't live in this repository.
15+
src/EditorFeatures/Core.Wpf/ @dotnet/roslyn-ide @dotnet/roslyn-vs-for-mac
16+
src/EditorFeatures/CSharp.Wpf/ @dotnet/roslyn-ide @dotnet/roslyn-vs-for-mac
17+
1018
src/Features/ @dotnet/roslyn-ide
1119
src/Interactive/ @dotnet/roslyn-interactive
1220
src/NuGet/ @dotnet/roslyn-infrastructure
1321
src/Scripting/ @dotnet/roslyn-interactive
1422
src/Setup/ @dotnet/roslyn-infrastructure
1523
src/Tools/ @dotnet/roslyn-infrastructure
24+
src/Tools/Source/CompilerGeneratorTools/ @dotnet/roslyn-compiler
1625
src/VisualStudio/ @dotnet/roslyn-ide
26+
src/VisualStudio/LiveShare @dotnet/roslyn-ide @daytonellwanger @srivatsn @aletsdelarosa
1727
src/Workspaces/ @dotnet/roslyn-ide
1828

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,6 @@ $RECYCLE.BIN/
186186
# Mac desktop service store files
187187
.DS_Store
188188

189-
# Visual Studio Code
190-
.vscode/
191-
192189
# JetBrains Rider
193190
.idea/
194191

.vscode/launch.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
// Use IntelliSense to find out which attributes exist for C# debugging
3+
// Use hover for the description of the existing attributes
4+
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": ".NET Core Launch (console)",
9+
"type": "coreclr",
10+
"request": "launch",
11+
"preLaunchTask": "build",
12+
// If you have changed target frameworks, make sure to update the program path.
13+
"program": "${workspaceFolder}/src/Compilers/CSharp/csc/bin/Debug/netcoreapp2.1/csc.dll",
14+
"args": [],
15+
"cwd": "${workspaceFolder}/src/Compilers/CSharp/csc",
16+
// For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
17+
"console": "internalConsole",
18+
"stopAtEntry": false
19+
},
20+
{
21+
"name": ".NET Core Attach",
22+
"type": "coreclr",
23+
"request": "attach",
24+
"processId": "${command:pickProcess}"
25+
}
26+
]
27+
}

.vscode/tasks.json

Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
{
2+
// See https://go.microsoft.com/fwlink/?LinkId=733558
3+
// for the documentation about the tasks.json format
4+
"version": "2.0.0",
5+
"tasks": [
6+
{
7+
"label": "build",
8+
"command": "./build.sh",
9+
"type": "shell",
10+
"args": [
11+
],
12+
"windows": {
13+
"command": "./build.cmd",
14+
},
15+
"problemMatcher": "$msCompile",
16+
"group": "build"
17+
},
18+
{
19+
"label": "build with analyzers",
20+
"command": "./build.sh",
21+
"type": "shell",
22+
"args": [
23+
"--runAnalyzers"
24+
],
25+
"windows": {
26+
"command": "./build.cmd",
27+
"args": [
28+
"-runAnalyzers"
29+
],
30+
},
31+
"problemMatcher": "$msCompile",
32+
"group": "build"
33+
},
34+
{
35+
"label": "build csc",
36+
"command": "./.dotnet/dotnet",
37+
"type": "shell",
38+
"args": [
39+
"msbuild",
40+
"-p:UseRoslynAnalyzers=false",
41+
"-p:GenerateFullPaths=true",
42+
"src/Compilers/CSharp/csc/csc.csproj"
43+
],
44+
"problemMatcher": "$msCompile",
45+
"group": "build"
46+
},
47+
{
48+
"label": "build current project",
49+
"type": "shell",
50+
"command": "./.dotnet/dotnet",
51+
"args": [
52+
"pwsh",
53+
"${workspaceRoot}/scripts/vscode-build.ps1",
54+
"-filePath",
55+
"${file}",
56+
"-msbuildEngine",
57+
"dotnet"
58+
],
59+
"windows": {
60+
"command": "powershell",
61+
"args": [
62+
"${workspaceRoot}/scripts/vscode-build.ps1",
63+
"-filePath",
64+
"${file}",
65+
"-msbuildEngine",
66+
"dotnet"
67+
],
68+
},
69+
"problemMatcher": "$msCompile",
70+
"group": "build"
71+
},
72+
{
73+
"label": "msbuild current project",
74+
"type": "shell",
75+
"command": "echo 'Task not supported on this OS'",
76+
"windows": {
77+
"command": "powershell",
78+
"args": [
79+
"${workspaceRoot}/scripts/vscode-build.ps1",
80+
"-filePath",
81+
"${file}",
82+
"-msbuildEngine",
83+
"vs"
84+
],
85+
},
86+
"problemMatcher": "$msCompile",
87+
"group": "build"
88+
},
89+
{
90+
"label": "generate compiler code",
91+
"command": "./.dotnet/dotnet",
92+
"type": "shell",
93+
"args": [
94+
"pwsh",
95+
"${workspaceRoot}/eng/generate-compiler-code.ps1"
96+
],
97+
"problemMatcher": "$msCompile",
98+
"group": "build"
99+
},
100+
{
101+
"label": "update xlf files",
102+
"command": "./build.sh",
103+
"type": "shell",
104+
"windows": {
105+
"command": "./build.cmd"
106+
},
107+
"options": {
108+
"env": { "UpdateXlfOnBuild": "true" }
109+
},
110+
"problemMatcher": "$msCompile",
111+
"group": "build"
112+
},
113+
{
114+
"label": "run tests in current file (netcoreapp3.1)",
115+
"command": "./.dotnet/dotnet",
116+
"type": "shell",
117+
"args": [
118+
"pwsh",
119+
"${workspaceRoot}/scripts/vscode-run-tests.ps1",
120+
"-filePath",
121+
"${file}",
122+
"-msbuildEngine",
123+
"dotnet",
124+
"-framework",
125+
"netcoreapp3.1",
126+
"-filter",
127+
"${fileBasenameNoExtension}"
128+
],
129+
"problemMatcher": "$msCompile",
130+
"group": "test"
131+
},
132+
{
133+
"label": "run tests in current project (netcoreapp3.1)",
134+
"command": "./.dotnet/dotnet",
135+
"type": "shell",
136+
"args": [
137+
"pwsh",
138+
"${workspaceRoot}/scripts/vscode-run-tests.ps1",
139+
"-filePath",
140+
"${file}",
141+
"-msbuildEngine",
142+
"dotnet",
143+
"-framework",
144+
"netcoreapp3.1"
145+
],
146+
"problemMatcher": "$msCompile",
147+
"group": "test"
148+
},
149+
{
150+
"label": "run tests in current file (all frameworks)",
151+
"command": "./.dotnet/dotnet",
152+
"type": "shell",
153+
"args": [
154+
"pwsh",
155+
"${workspaceRoot}/scripts/vscode-run-tests.ps1",
156+
"-filePath",
157+
"${file}",
158+
"-filter",
159+
"${fileBasenameNoExtension}"
160+
],
161+
"problemMatcher": "$msCompile",
162+
"group": "test"
163+
},
164+
{
165+
"label": "run tests in current project (all frameworks)",
166+
"command": "./.dotnet/dotnet",
167+
"type": "shell",
168+
"args": [
169+
"pwsh",
170+
"${workspaceRoot}/scripts/vscode-run-tests.ps1",
171+
"-filePath",
172+
"${file}"
173+
],
174+
"problemMatcher": "$msCompile",
175+
"group": "test"
176+
}
177+
]
178+
}

.vsconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"version": "1.0",
3+
"components": [
4+
"Microsoft.VisualStudio.Workload.CoreEditor",
5+
"Microsoft.VisualStudio.Workload.ManagedDesktop",
6+
"Microsoft.VisualStudio.Workload.NetCoreTools",
7+
"Microsoft.VisualStudio.Workload.VisualStudioExtension"
8+
]
9+
}

CODE-OF-CONDUCT.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Code of Conduct
2+
3+
This project has adopted the code of conduct defined by the Contributor Covenant
4+
to clarify expected behavior in our community.
5+
6+
For more information, see the [.NET Foundation Code of Conduct](https://dotnetfoundation.org/code-of-conduct).

CONTRIBUTING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ These two blogs posts on contributing code to open source projects are good too:
2727

2828
## Coding Style
2929

30-
The Roslyn project is a member of the [.NET Foundation](https://github.com/orgs/dotnet) and follows the same [developer guide](https://github.com/dotnet/corefx/blob/master/Documentation/coding-guidelines/coding-style.md). The repo also includes [.editorconfig](http://editorconfig.org) files to help enforce this convention. Contributors should ensure they follow these guidelines when making submissions.
30+
The Roslyn project is a member of the [.NET Foundation](https://github.com/orgs/dotnet) and follows the same [developer guide](https://github.com/dotnet/runtime/blob/master/docs/coding-guidelines/coding-style.md). The repo also includes [.editorconfig](http://editorconfig.org) files to help enforce this convention. Contributors should ensure they follow these guidelines when making submissions.
3131

3232
### CSharp
3333

34-
- **DO** use the coding style outlined in the [.NET Foundation Coding Guidelines](https://github.com/dotnet/corefx/blob/master/Documentation/coding-guidelines/coding-style.md)
34+
- **DO** use the coding style outlined in the [.NET Runtime Coding Guidelines](https://github.com/dotnet/runtime/blob/master/docs/coding-guidelines/coding-style.md)
3535
- **DO** use plain code to validate parameters at public boundaries. Do not use Contracts or magic helpers.
3636

3737
```csharp
@@ -41,7 +41,7 @@ if (argument == null)
4141
}
4242
```
4343

44-
- **DO** use `Debug.Assert()` for checks not needed in retail builds. Always include a “message” string in your assert to identify failure conditions. Add assertions to document assumptions on non-local program state or parameter values, e.g. “At this point in parsing the scanner should have been advanced to a ‘.’ token by the caller”.
44+
- **DO** use `Debug.Assert()` for checks not needed in release builds. Always include a “message” string in your assert to identify failure conditions. Add assertions to document assumptions on non-local program state or parameter values, e.g. “At this point in parsing the scanner should have been advanced to a ‘.’ token by the caller”.
4545
- **DO** avoid allocations in compiler hot paths:
4646
- Avoid LINQ.
4747
- Avoid using `foreach` over collections that do not have a `struct` enumerator.
@@ -53,4 +53,4 @@ if (argument == null)
5353
- **DO** place all field declarations at the beginning of a type definition
5454

5555
### Tips 'n' Tricks
56-
Our team finds using [this enhanced source view](http://source.roslyn.io/) of Roslyn helpful when developing.
56+
Our team finds using [this enhanced source view](http://sourceroslyn.io/) of Roslyn helpful when developing.

0 commit comments

Comments
 (0)