Skip to content

Commit 475bfb1

Browse files
authored
Merge pull request #44527 from dotnet/merges/master-to-master-vs-deps
Merge master to master-vs-deps
2 parents 57af2cd + 287a25a commit 475bfb1

File tree

69 files changed

+389
-249
lines changed

Some content is hidden

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

69 files changed

+389
-249
lines changed

.editorconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,3 +264,9 @@ dotnet_diagnostic.IDE0060.severity = warning
264264

265265
# CA1822: Make member static
266266
dotnet_diagnostic.CA1822.severity = warning
267+
268+
# Prefer "var" everywhere
269+
dotnet_diagnostic.IDE0007.severity = warning
270+
csharp_style_var_for_built_in_types = true:warning
271+
csharp_style_var_when_type_is_apparent = true:warning
272+
csharp_style_var_elsewhere = true:warning

azure-pipelines.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
release_64:
3535
_configuration: Release
3636
_testKind: Test64
37-
timeoutInMinutes: 90
37+
timeoutInMinutes: 120
3838

3939
steps:
4040
- script: eng/cibuild.cmd -configuration $(_configuration) -prepareMachine -testDesktop -$(_testKind) -procdump
@@ -62,7 +62,7 @@ jobs:
6262
pool:
6363
name: NetCorePublic-Pool
6464
queue: BuildPool.Windows.10.Amd64.ES.VS2017.Open
65-
timeoutInMinutes: 105
65+
timeoutInMinutes: 120
6666

6767
steps:
6868
- script: eng/cibuild.cmd -configuration Debug -prepareMachine -testDesktop

eng/build.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ function TestUsingOptimizedRunner() {
423423
if ($testVsi) {
424424
$args += " -timeout:110"
425425
} else {
426-
$args += " -timeout:75"
426+
$args += " -timeout:90"
427427
}
428428
}
429429

src/Analyzers/CSharp/CodeFixes/ConvertSwitchStatementToExpression/ConvertSwitchStatementToExpressionCodeFixProvider.Rewriter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ private static PatternSyntax GetPattern(SyntaxList<SwitchLabelSyntax> switchLabe
128128

129129
#if !CODE_STYLE
130130

131-
for (int i = 1; i < switchLabels.Count; i++)
131+
for (var i = 1; i < switchLabels.Count; i++)
132132
{
133133
var nextPatternPart = GetPattern(switchLabels[i], out whenClauseUnused);
134134
Debug.Assert(whenClauseUnused == null, "We should not have offered to convert multiple cases if any have a when clause");

src/Analyzers/CSharp/Tests/UseExplicitTupleName/UseExplicitTupleNameTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ void M()
231231
[Fact, Trait(Traits.Feature, Traits.Features.CodeActionsUseExplicitTupleName)]
232232
public async Task TestOnRestField()
233233
{
234-
string valueTuple8 = @"
234+
var valueTuple8 = @"
235235
namespace System
236236
{
237237
public struct ValueTuple<T1>

src/EditorFeatures/Test2/IntelliSense/CSharpCompletionCommandHandlerTests_XmlDoc.vb

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1233,5 +1233,54 @@ class c
12331233
Await state.AssertSelectedCompletionItem(displayText:="param name=""bar""")
12341234
End Using
12351235
End Function
1236+
1237+
<WorkItem(44472, "https://github.com/dotnet/roslyn/issues/44472")>
1238+
<WpfTheory, CombinatorialData, Trait(Traits.Feature, Traits.Features.Completion)>
1239+
Public Async Function InvokeWithAliasAndImportedNamespace(showCompletionInArgumentLists As Boolean) As Task
1240+
1241+
Using state = TestStateFactory.CreateTestStateFromWorkspace(
1242+
<Workspace>
1243+
<Project Language="C#" AssemblyName="Assembly1" CommonReferences="true">
1244+
<Document>
1245+
using System;
1246+
using System.Collections.Generic;
1247+
using System.Text;
1248+
1249+
namespace First.NestedA
1250+
{
1251+
public class MyClass
1252+
{
1253+
}
1254+
}
1255+
</Document>
1256+
<Document>
1257+
using First.NestedA;
1258+
using MyClassLongDescription = First.NestedA.MyClass;
1259+
1260+
namespace Second.NestedB
1261+
{
1262+
class OtherClass
1263+
{
1264+
/// &lt;summary&gt;
1265+
/// This is from &lt;see cref="MyClassL$$"/&gt;
1266+
/// &lt;/summary&gt;
1267+
public void Method()
1268+
{
1269+
}
1270+
}
1271+
}
1272+
</Document>
1273+
</Project>
1274+
</Workspace>, showCompletionInArgumentLists:=showCompletionInArgumentLists)
1275+
1276+
state.SendInvokeCompletionList()
1277+
Await state.AssertCompletionSession()
1278+
Await state.AssertSelectedCompletionItem(displayText:="MyClassLongDescription")
1279+
state.SendTab()
1280+
Await state.AssertNoCompletionSession()
1281+
1282+
Await state.AssertLineTextAroundCaret(" /// This is from <see cref=""MyClassLongDescription", """/>")
1283+
End Using
1284+
End Function
12361285
End Class
12371286
End Namespace

src/Features/CSharp/Portable/ChangeSignature/CSharpChangeSignatureService.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,10 @@ private static bool IsParamsArrayExpanded(SemanticModel semanticModel, SyntaxNod
560560
}
561561
else
562562
{
563+
#pragma warning disable IDE0007 // Use implicit type - Using 'var' causes "error CS8506: No best type was found for the switch expression"
564+
// TODO: File a bug on IDE0007 analyzer
563565
BaseArgumentListSyntax? argumentList = node switch
566+
#pragma warning restore IDE0007 // Use implicit type
564567
{
565568
InvocationExpressionSyntax invocation => invocation.ArgumentList,
566569
ObjectCreationExpressionSyntax objectCreation => objectCreation.ArgumentList,

src/Features/CSharp/Portable/Completion/CompletionProviders/CrefCompletionProvider.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,7 @@ private static CompletionItem CreateItemFromBuilder(ISymbol symbol, int position
385385
symbols: ImmutableArray.Create(symbol),
386386
contextPosition: position,
387387
sortText: symbolText,
388+
filterText: insertionText,
388389
properties: options,
389390
rules: GetRules(insertionText));
390391
}

src/Features/CSharp/Portable/ConvertIfToSwitch/CSharpConvertIfToSwitchCodeRefactoringProvider.Rewriting.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ private static SwitchExpressionArmSyntax AsSwitchExpressionArmSyntax(AnalyzedSwi
4747

4848
Debug.Assert(whenClause == null || section.Labels.Length == 1, "We shouldn't have guards when we're combining multiple cases into a single arm");
4949

50-
for (int i = 1; i < section.Labels.Length; i++)
50+
for (var i = 1; i < section.Labels.Length; i++)
5151
{
5252
var label = section.Labels[i];
5353
Debug.Assert(label.Guards.Length == 0, "We shouldn't have guards when we're combining multiple cases into a single arm");

src/Features/CSharp/Portable/EditAndContinue/CSharpEditAndContinueAnalyzer.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ protected override SyntaxNode GetEncompassingAncestorImpl(SyntaxNode bodyOrMatch
256256

257257
protected override SyntaxNode FindStatementAndPartner(SyntaxNode declarationBody, TextSpan span, SyntaxNode? partnerDeclarationBody, out SyntaxNode? partner, out int statementPart)
258258
{
259-
int position = span.Start;
259+
var position = span.Start;
260260

261261
SyntaxUtilities.AssertIsBody(declarationBody, allowLambda: false);
262262

@@ -306,7 +306,7 @@ protected override SyntaxNode FindStatementAndPartner(SyntaxNode declarationBody
306306

307307
while (true)
308308
{
309-
bool isBody = node == declarationBody || LambdaUtilities.IsLambdaBodyStatementOrExpression(node);
309+
var isBody = node == declarationBody || LambdaUtilities.IsLambdaBodyStatementOrExpression(node);
310310

311311
if (isBody || StatementSyntaxComparer.HasLabel(node))
312312
{
@@ -513,7 +513,7 @@ internal override bool IsClosureScope(SyntaxNode node)
513513
{
514514
var root = GetEncompassingAncestor(container);
515515

516-
SyntaxNode? current = node;
516+
var current = node;
517517
while (current != root && current != null)
518518
{
519519
if (LambdaUtilities.IsLambdaBodyStatementOrExpression(current, out var body))
@@ -2981,7 +2981,7 @@ protected override List<SyntaxNode> GetExceptionHandlingAncestors(SyntaxNode nod
29812981
{
29822982
var result = new List<SyntaxNode>();
29832983

2984-
SyntaxNode? current = node;
2984+
var current = node;
29852985
while (current != null)
29862986
{
29872987
var kind = current.Kind();

0 commit comments

Comments
 (0)