Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
013a4258
R
roslyn
项目概览
lwm1986
/
roslyn
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
roslyn
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
013a4258
编写于
6月 28, 2019
作者:
C
Cyrus Najmabadi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use 'var'
上级
e7080140
变更
19
隐藏空白更改
内联
并排
Showing
19 changed file
with
25 addition
and
25 deletion
+25
-25
src/Features/CSharp/Portable/ChangeSignature/CSharpChangeSignatureService.cs
.../Portable/ChangeSignature/CSharpChangeSignatureService.cs
+2
-2
src/Features/CSharp/Portable/CodeRefactorings/LambdaSimplifier/LambdaSimplifierCodeRefactoringProvider.cs
...mbdaSimplifier/LambdaSimplifierCodeRefactoringProvider.cs
+1
-1
src/Features/CSharp/Portable/Completion/CompletionProviders/CrefCompletionProvider.cs
.../Completion/CompletionProviders/CrefCompletionProvider.cs
+1
-1
src/Features/CSharp/Portable/Completion/CompletionProviders/DeclarationNameCompletionProvider.DeclarationInfo.cs
...ders/DeclarationNameCompletionProvider.DeclarationInfo.cs
+1
-1
src/Features/CSharp/Portable/Completion/CompletionProviders/SymbolCompletionProvider.cs
...ompletion/CompletionProviders/SymbolCompletionProvider.cs
+3
-3
src/Features/CSharp/Portable/Diagnostics/Analyzers/CSharpUnboundIdentifiersDiagnosticAnalyzer.cs
...s/Analyzers/CSharpUnboundIdentifiersDiagnosticAnalyzer.cs
+1
-1
src/Features/CSharp/Portable/EditAndContinue/BreakpointSpans.cs
...atures/CSharp/Portable/EditAndContinue/BreakpointSpans.cs
+1
-1
src/Features/CSharp/Portable/EditAndContinue/CSharpEditAndContinueAnalyzer.cs
...Portable/EditAndContinue/CSharpEditAndContinueAnalyzer.cs
+1
-1
src/Features/CSharp/Portable/ExtractMethod/CSharpMethodExtractor.Analyzer.cs
.../Portable/ExtractMethod/CSharpMethodExtractor.Analyzer.cs
+1
-1
src/Features/CSharp/Portable/ExtractMethod/Extensions.cs
src/Features/CSharp/Portable/ExtractMethod/Extensions.cs
+2
-2
src/Features/CSharp/Portable/GenerateType/CSharpGenerateTypeService.cs
...CSharp/Portable/GenerateType/CSharpGenerateTypeService.cs
+1
-1
src/Features/CSharp/Portable/InlineDeclaration/CSharpInlineDeclarationCodeFixProvider.cs
...lineDeclaration/CSharpInlineDeclarationCodeFixProvider.cs
+2
-2
src/Features/CSharp/Portable/IntroduceVariable/CSharpIntroduceVariableService_IntroduceField.cs
...Variable/CSharpIntroduceVariableService_IntroduceField.cs
+1
-1
src/Features/CSharp/Portable/RemoveUnnecessaryImports/AbstractCSharpRemoveUnnecessaryImportsService.Rewriter.cs
...AbstractCSharpRemoveUnnecessaryImportsService.Rewriter.cs
+2
-2
src/Features/CSharp/Portable/SignatureHelp/AttributeSignatureHelpProvider.cs
.../Portable/SignatureHelp/AttributeSignatureHelpProvider.cs
+1
-1
src/Features/CSharp/Portable/TypeStyle/UseExplicitTypeCodeFixProvider.cs
...harp/Portable/TypeStyle/UseExplicitTypeCodeFixProvider.cs
+1
-1
src/Features/CSharp/Portable/UseCollectionInitializer/CSharpUseCollectionInitializerCodeFixProvider.cs
...tializer/CSharpUseCollectionInitializerCodeFixProvider.cs
+1
-1
src/Features/CSharp/Portable/UseObjectInitializer/CSharpUseObjectInitializerCodeFixProvider.cs
...tInitializer/CSharpUseObjectInitializerCodeFixProvider.cs
+1
-1
src/Features/CSharp/Portable/UseSimpleUsingStatement/UseSimpleUsingStatementDiagnosticAnalyzer.cs
...ingStatement/UseSimpleUsingStatementDiagnosticAnalyzer.cs
+1
-1
未找到文件。
src/Features/CSharp/Portable/ChangeSignature/CSharpChangeSignatureService.cs
浏览文件 @
013a4258
...
...
@@ -585,7 +585,7 @@ private List<SyntaxTrivia> GetPermutedTrivia(CSharpSyntaxNode node, List<XmlElem
var
updatedNodeList
=
new
List
<
XmlNodeSyntax
>();
var
structuredContent
=
structuredTrivia
.
Content
.
ToList
();
for
(
int
i
=
0
;
i
<
structuredContent
.
Count
;
i
++)
for
(
var
i
=
0
;
i
<
structuredContent
.
Count
;
i
++)
{
var
content
=
structuredContent
[
i
];
if
(!
content
.
IsKind
(
SyntaxKind
.
XmlElement
))
...
...
@@ -627,7 +627,7 @@ private List<SyntaxTrivia> GetPermutedTrivia(CSharpSyntaxNode node, List<XmlElem
private
static
List
<
SyntaxToken
>
GetSeparators
<
T
>(
SeparatedSyntaxList
<
T
>
arguments
,
int
numSeparatorsToSkip
=
0
)
where
T
:
SyntaxNode
{
var
separators
=
new
List
<
SyntaxToken
>();
for
(
int
i
=
0
;
i
<
arguments
.
SeparatorCount
-
numSeparatorsToSkip
;
i
++)
for
(
var
i
=
0
;
i
<
arguments
.
SeparatorCount
-
numSeparatorsToSkip
;
i
++)
{
separators
.
Add
(
arguments
.
GetSeparator
(
i
));
}
...
...
src/Features/CSharp/Portable/CodeRefactorings/LambdaSimplifier/LambdaSimplifierCodeRefactoringProvider.cs
浏览文件 @
013a4258
...
...
@@ -197,7 +197,7 @@ public override async Task ComputeRefactoringsAsync(CodeRefactoringContext conte
}
// Parameter types have to be contravariant.
for
(
int
i
=
0
;
i
<
lambdaMethod
.
Parameters
.
Length
;
i
++)
for
(
var
i
=
0
;
i
<
lambdaMethod
.
Parameters
.
Length
;
i
++)
{
var
conversion
=
document
.
SemanticModel
.
Compilation
.
ClassifyConversion
(
lambdaMethod
.
Parameters
[
i
].
Type
,
invocationMethod
.
Parameters
[
i
].
Type
);
...
...
src/Features/CSharp/Portable/Completion/CompletionProviders/CrefCompletionProvider.cs
浏览文件 @
013a4258
...
...
@@ -330,7 +330,7 @@ private static TextSpan GetCompletionItemSpan(SourceText text, int position)
builder
.
Append
(
symbol
.
IsIndexer
()
?
'['
:
'('
);
for
(
int
i
=
0
;
i
<
parameters
.
Length
;
i
++)
for
(
var
i
=
0
;
i
<
parameters
.
Length
;
i
++)
{
if
(
i
>
0
)
{
...
...
src/Features/CSharp/Portable/Completion/CompletionProviders/DeclarationNameCompletionProvider.DeclarationInfo.cs
浏览文件 @
013a4258
...
...
@@ -515,7 +515,7 @@ private static DeclarationModifiers GetDeclarationModifiers(SyntaxTokenList modi
private
static
Accessibility
?
GetAccessibility
(
SyntaxTokenList
modifiers
)
{
for
(
int
i
=
modifiers
.
Count
-
1
;
i
>=
0
;
i
--)
for
(
var
i
=
modifiers
.
Count
-
1
;
i
>=
0
;
i
--)
{
var
modifier
=
modifiers
[
i
];
switch
(
modifier
.
Kind
())
...
...
src/Features/CSharp/Portable/Completion/CompletionProviders/SymbolCompletionProvider.cs
浏览文件 @
013a4258
...
...
@@ -90,11 +90,11 @@ protected override CompletionItemRules GetCompletionItemRules(List<ISymbol> symb
{
var
result
=
new
Dictionary
<
ValueTuple
<
bool
,
bool
,
bool
>,
CompletionItemRules
>();
for
(
int
importDirective
=
0
;
importDirective
<
2
;
importDirective
++)
for
(
var
importDirective
=
0
;
importDirective
<
2
;
importDirective
++)
{
for
(
int
preselect
=
0
;
preselect
<
2
;
preselect
++)
for
(
var
preselect
=
0
;
preselect
<
2
;
preselect
++)
{
for
(
int
tupleLiteral
=
0
;
tupleLiteral
<
2
;
tupleLiteral
++)
for
(
var
tupleLiteral
=
0
;
tupleLiteral
<
2
;
tupleLiteral
++)
{
if
(
importDirective
==
1
&&
tupleLiteral
==
1
)
{
...
...
src/Features/CSharp/Portable/Diagnostics/Analyzers/CSharpUnboundIdentifiersDiagnosticAnalyzer.cs
浏览文件 @
013a4258
...
...
@@ -45,7 +45,7 @@ protected override bool ConstructorDoesNotExist(SyntaxNode node, SymbolInfo info
.
WhereAsArray
(
constructor
=>
constructor
.
Parameters
.
Length
==
args
.
Count
)
.
WhereAsArray
(
constructor
=>
{
for
(
int
i
=
0
;
i
<
constructor
.
Parameters
.
Length
;
i
++)
for
(
var
i
=
0
;
i
<
constructor
.
Parameters
.
Length
;
i
++)
{
var
typeInfo
=
model
.
GetTypeInfo
(
args
[
i
].
Expression
);
if
(!
constructor
.
Parameters
[
i
].
Type
.
Equals
(
typeInfo
.
ConvertedType
))
...
...
src/Features/CSharp/Portable/EditAndContinue/BreakpointSpans.cs
浏览文件 @
013a4258
...
...
@@ -38,7 +38,7 @@ private static bool IsBlank(TextLine line)
{
var
text
=
line
.
ToString
();
for
(
int
i
=
0
;
i
<
text
.
Length
;
i
++)
for
(
var
i
=
0
;
i
<
text
.
Length
;
i
++)
{
if
(!
SyntaxFacts
.
IsWhitespace
(
text
[
i
]))
{
...
...
src/Features/CSharp/Portable/EditAndContinue/CSharpEditAndContinueAnalyzer.cs
浏览文件 @
013a4258
...
...
@@ -3333,7 +3333,7 @@ private static bool DeclareSameIdentifiers(SyntaxToken[] oldVariables, SyntaxTok
return
false
;
}
for
(
int
i
=
0
;
i
<
oldVariables
.
Length
;
i
++)
for
(
var
i
=
0
;
i
<
oldVariables
.
Length
;
i
++)
{
if
(!
SyntaxFactory
.
AreEquivalent
(
oldVariables
[
i
],
newVariables
[
i
]))
{
...
...
src/Features/CSharp/Portable/ExtractMethod/CSharpMethodExtractor.Analyzer.cs
浏览文件 @
013a4258
...
...
@@ -47,7 +47,7 @@ protected override int GetIndexOfVariableInfoToUseAsReturnValue(IList<VariableIn
var
outSymbolIndex
=
-
1
;
var
refSymbolIndex
=
-
1
;
for
(
int
i
=
0
;
i
<
variableInfo
.
Count
;
i
++)
for
(
var
i
=
0
;
i
<
variableInfo
.
Count
;
i
++)
{
var
variable
=
variableInfo
[
i
];
...
...
src/Features/CSharp/Portable/ExtractMethod/Extensions.cs
浏览文件 @
013a4258
...
...
@@ -164,8 +164,8 @@ public static bool ContainArgumentlessThrowWithoutEnclosingCatch(this IEnumerabl
public
static
bool
ContainPreprocessorCrossOver
(
this
IEnumerable
<
SyntaxToken
>
tokens
,
TextSpan
textSpan
)
{
int
activeRegions
=
0
;
int
activeIfs
=
0
;
var
activeRegions
=
0
;
var
activeIfs
=
0
;
foreach
(
var
trivia
in
tokens
.
GetAllTrivia
())
{
...
...
src/Features/CSharp/Portable/GenerateType/CSharpGenerateTypeService.cs
浏览文件 @
013a4258
...
...
@@ -683,7 +683,7 @@ private NamespaceDeclarationSyntax GetDeclaringNamespace(List<string> containers
private
bool
IdentifierMatches
(
int
indexDone
,
List
<
string
>
namespaceContainers
,
List
<
string
>
containers
)
{
for
(
int
i
=
0
;
i
<
namespaceContainers
.
Count
;
++
i
)
for
(
var
i
=
0
;
i
<
namespaceContainers
.
Count
;
++
i
)
{
if
(
namespaceContainers
[
i
]
!=
containers
[
indexDone
+
i
])
{
...
...
src/Features/CSharp/Portable/InlineDeclaration/CSharpInlineDeclarationCodeFixProvider.cs
浏览文件 @
013a4258
...
...
@@ -131,7 +131,7 @@ public override Task RegisterCodeFixesAsync(CodeFixContext context)
// Try to find a predecessor Statement on the same line that isn't going to be removed
StatementSyntax
priorStatementSyntax
=
null
;
var
localDeclarationToken
=
localDeclarationStatement
.
GetFirstToken
();
for
(
int
i
=
declarationIndex
-
1
;
i
>=
0
;
i
--)
for
(
var
i
=
declarationIndex
-
1
;
i
>=
0
;
i
--)
{
var
statementSyntax
=
block
.
Statements
[
i
];
if
(
declarationsToRemove
.
Contains
(
statementSyntax
))
...
...
@@ -168,7 +168,7 @@ public override Task RegisterCodeFixesAsync(CodeFixContext context)
// We initialize this to null here but we must see at least the statement
// into which the declaration is going to be inlined so this will be not null
StatementSyntax
nextStatementSyntax
=
null
;
for
(
int
i
=
declarationIndex
+
1
;
i
<
block
.
Statements
.
Count
;
i
++)
for
(
var
i
=
declarationIndex
+
1
;
i
<
block
.
Statements
.
Count
;
i
++)
{
var
statement
=
block
.
Statements
[
i
];
if
(!
declarationsToRemove
.
Contains
(
statement
))
...
...
src/Features/CSharp/Portable/IntroduceVariable/CSharpIntroduceVariableService_IntroduceField.cs
浏览文件 @
013a4258
...
...
@@ -158,7 +158,7 @@ private static bool IsConstantField(MemberDeclarationSyntax member)
protected
static
int
DetermineFirstChange
(
SyntaxList
<
MemberDeclarationSyntax
>
oldMembers
,
SyntaxList
<
MemberDeclarationSyntax
>
newMembers
)
{
for
(
int
i
=
0
;
i
<
oldMembers
.
Count
;
i
++)
for
(
var
i
=
0
;
i
<
oldMembers
.
Count
;
i
++)
{
if
(!
SyntaxFactory
.
AreEquivalent
(
oldMembers
[
i
],
newMembers
[
i
],
topLevel
:
false
))
{
...
...
src/Features/CSharp/Portable/RemoveUnnecessaryImports/AbstractCSharpRemoveUnnecessaryImportsService.Rewriter.cs
浏览文件 @
013a4258
...
...
@@ -49,7 +49,7 @@ public override SyntaxNode DefaultVisit(SyntaxNode node)
var
currentUsings
=
new
List
<
UsingDirectiveSyntax
>(
usings
);
finalTrivia
=
default
;
for
(
int
i
=
0
;
i
<
usings
.
Count
;
i
++)
for
(
var
i
=
0
;
i
<
usings
.
Count
;
i
++)
{
if
(
usingsToRemove
.
Contains
(
usings
[
i
]))
{
...
...
@@ -104,7 +104,7 @@ private bool ShouldPreserveTrivia(SyntaxTriviaList trivia)
Debug
.
Assert
(
oldUsings
.
Count
==
newUsings
.
Count
);
var
result
=
new
HashSet
<
UsingDirectiveSyntax
>();
for
(
int
i
=
0
;
i
<
oldUsings
.
Count
;
i
++)
for
(
var
i
=
0
;
i
<
oldUsings
.
Count
;
i
++)
{
if
(
_unnecessaryUsingsDoNotAccessDirectly
.
Contains
(
oldUsings
[
i
]))
{
...
...
src/Features/CSharp/Portable/SignatureHelp/AttributeSignatureHelpProvider.cs
浏览文件 @
013a4258
...
...
@@ -162,7 +162,7 @@ public override SignatureHelpState GetCurrentArgumentState(SyntaxNode root, int
result
.
Add
(
Convert
(
parameter
,
semanticModel
,
position
,
documentationCommentFormatter
,
cancellationToken
));
}
for
(
int
i
=
0
;
i
<
namedParameters
.
Count
;
i
++)
for
(
var
i
=
0
;
i
<
namedParameters
.
Count
;
i
++)
{
cancellationToken
.
ThrowIfCancellationRequested
();
...
...
src/Features/CSharp/Portable/TypeStyle/UseExplicitTypeCodeFixProvider.cs
浏览文件 @
013a4258
...
...
@@ -119,7 +119,7 @@ private static ExpressionSyntax GenerateTupleDeclaration(ITypeSymbol typeSymbol,
Debug
.
Assert
(
elements
.
Length
==
parensDesignation
.
Variables
.
Count
);
var
builder
=
ArrayBuilder
<
SyntaxNode
>.
GetInstance
(
elements
.
Length
);
for
(
int
i
=
0
;
i
<
elements
.
Length
;
i
++)
for
(
var
i
=
0
;
i
<
elements
.
Length
;
i
++)
{
var
designation
=
parensDesignation
.
Variables
[
i
];
var
type
=
elements
[
i
].
Type
;
...
...
src/Features/CSharp/Portable/UseCollectionInitializer/CSharpUseCollectionInitializerCodeFixProvider.cs
浏览文件 @
013a4258
...
...
@@ -51,7 +51,7 @@ public CSharpUseCollectionInitializerCodeFixProvider()
ImmutableArray
<
ExpressionStatementSyntax
>
matches
)
{
var
nodesAndTokens
=
new
List
<
SyntaxNodeOrToken
>();
for
(
int
i
=
0
;
i
<
matches
.
Length
;
i
++)
for
(
var
i
=
0
;
i
<
matches
.
Length
;
i
++)
{
var
expressionStatement
=
matches
[
i
];
...
...
src/Features/CSharp/Portable/UseObjectInitializer/CSharpUseObjectInitializerCodeFixProvider.cs
浏览文件 @
013a4258
...
...
@@ -46,7 +46,7 @@ public CSharpUseObjectInitializerCodeFixProvider()
ImmutableArray
<
Match
<
ExpressionSyntax
,
StatementSyntax
,
MemberAccessExpressionSyntax
,
ExpressionStatementSyntax
>>
matches
)
{
var
nodesAndTokens
=
new
List
<
SyntaxNodeOrToken
>();
for
(
int
i
=
0
;
i
<
matches
.
Length
;
i
++)
for
(
var
i
=
0
;
i
<
matches
.
Length
;
i
++)
{
var
match
=
matches
[
i
];
var
expressionStatement
=
match
.
Statement
;
...
...
src/Features/CSharp/Portable/UseSimpleUsingStatement/UseSimpleUsingStatementDiagnosticAnalyzer.cs
浏览文件 @
013a4258
...
...
@@ -188,7 +188,7 @@ private static bool DeclaredLocalCausesCollision(ILookup<string, ISymbol> symbol
// Note: we only have to check up to the `using`, since the checks below in
// UsingValueDoesNotLeakToFollowingStatements ensure that there would be no
// labels/gotos *after* the using statement.
for
(
int
i
=
0
;
i
<
index
;
i
++)
for
(
var
i
=
0
;
i
<
index
;
i
++)
{
var
priorStatement
=
parentStatements
[
i
];
if
(
IsGotoOrLabeledStatement
(
priorStatement
))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录