Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
7c5642ec
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,发现更多精彩内容 >>
提交
7c5642ec
编写于
6月 28, 2019
作者:
C
Cyrus Najmabadi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use var
上级
76d6ac21
变更
28
隐藏空白更改
内联
并排
Showing
28 changed file
with
52 addition
and
52 deletion
+52
-52
src/EditorFeatures/Core/Implementation/CodeFixes/CodeFixService.cs
...rFeatures/Core/Implementation/CodeFixes/CodeFixService.cs
+4
-4
src/EditorFeatures/Core/Implementation/Commands/CommandHandlerService.cs
...res/Core/Implementation/Commands/CommandHandlerService.cs
+4
-4
src/EditorFeatures/Core/Implementation/DocumentationComments/AbstractDocumentationCommentCommandHandler.cs
...ionComments/AbstractDocumentationCommentCommandHandler.cs
+5
-5
src/EditorFeatures/Core/Implementation/EditAndContinue/ActiveStatementTagger.cs
...e/Implementation/EditAndContinue/ActiveStatementTagger.cs
+1
-1
src/EditorFeatures/Core/Implementation/EditAndContinue/ActiveStatementTrackingService.cs
...ntation/EditAndContinue/ActiveStatementTrackingService.cs
+6
-6
src/EditorFeatures/Core/Implementation/EditAndContinue/ReadOnlyDocumentTracker.cs
...Implementation/EditAndContinue/ReadOnlyDocumentTracker.cs
+1
-1
src/EditorFeatures/Core/Implementation/ExtractMethod/AbstractExtractMethodCommandHandler.cs
...tion/ExtractMethod/AbstractExtractMethodCommandHandler.cs
+1
-1
src/EditorFeatures/Core/Implementation/Formatting/Indentation/AbstractSmartTokenFormatterCommandHandler.cs
.../Indentation/AbstractSmartTokenFormatterCommandHandler.cs
+2
-2
src/EditorFeatures/Core/Implementation/IntelliSense/AsyncCompletion/CommitManager.cs
...lementation/IntelliSense/AsyncCompletion/CommitManager.cs
+1
-1
src/EditorFeatures/Core/Implementation/IntelliSense/AsyncCompletion/ItemManager.cs
...mplementation/IntelliSense/AsyncCompletion/ItemManager.cs
+2
-2
src/EditorFeatures/Core/Implementation/IntelliSense/Completion/Controller.Session_FilterModel.cs
...IntelliSense/Completion/Controller.Session_FilterModel.cs
+2
-2
src/EditorFeatures/Core/Implementation/IntelliSense/Completion/Controller.cs
...Core/Implementation/IntelliSense/Completion/Controller.cs
+1
-1
src/EditorFeatures/Core/Implementation/IntelliSense/Completion/Controller_ToggleCompletionMode.cs
...ntelliSense/Completion/Controller_ToggleCompletionMode.cs
+1
-1
src/EditorFeatures/Core/Implementation/IntelliSense/Completion/PrioritizedTaskScheduler.cs
...ation/IntelliSense/Completion/PrioritizedTaskScheduler.cs
+1
-1
src/EditorFeatures/Core/Implementation/IntelliSense/SignatureHelp/Controller.Session_ComputeModel.cs
...lliSense/SignatureHelp/Controller.Session_ComputeModel.cs
+1
-1
src/EditorFeatures/Core/Implementation/IntelliSense/SignatureHelp/Presentation/Signature.cs
...tion/IntelliSense/SignatureHelp/Presentation/Signature.cs
+1
-1
src/EditorFeatures/Core/Implementation/NavigationBar/NavigationBarController_ModelComputation.cs
...NavigationBar/NavigationBarController_ModelComputation.cs
+2
-2
src/EditorFeatures/Core/Implementation/Peek/DefinitionPeekableItem.cs
...atures/Core/Implementation/Peek/DefinitionPeekableItem.cs
+1
-1
src/EditorFeatures/Core/Implementation/RenameTracking/RenameTrackingTaggerProvider.RenameTrackingCommitter.cs
...g/RenameTrackingTaggerProvider.RenameTrackingCommitter.cs
+1
-1
src/EditorFeatures/Core/Implementation/RenameTracking/RenameTrackingTaggerProvider.StateMachine.cs
...nameTracking/RenameTrackingTaggerProvider.StateMachine.cs
+4
-4
src/EditorFeatures/Core/Implementation/TextStructureNavigation/AbstractTextStructureNavigatorProvider.TextStructureNavigator.cs
...tTextStructureNavigatorProvider.TextStructureNavigator.cs
+2
-2
src/EditorFeatures/Core/Shared/Extensions/IProjectionBufferFactoryServiceExtensions.cs
...d/Extensions/IProjectionBufferFactoryServiceExtensions.cs
+1
-1
src/EditorFeatures/Core/Shared/Tagging/Utilities/TagSpanIntervalTree.cs
...ures/Core/Shared/Tagging/Utilities/TagSpanIntervalTree.cs
+1
-1
src/EditorFeatures/Core/Shared/Utilities/ForegroundThreadAffinitizedObject.cs
...ore/Shared/Utilities/ForegroundThreadAffinitizedObject.cs
+1
-1
src/EditorFeatures/Core/Shared/Utilities/HACK_TextUndoTransactionThatRollsBackProperly.cs
...tilities/HACK_TextUndoTransactionThatRollsBackProperly.cs
+1
-1
src/EditorFeatures/Core/Tagging/AbstractAsynchronousTaggerProvider.TagSource_ProduceTags.cs
...stractAsynchronousTaggerProvider.TagSource_ProduceTags.cs
+1
-1
src/EditorFeatures/Core/Wrapping/BinaryExpression/AbstractBinaryExpressionWrapper.cs
...pping/BinaryExpression/AbstractBinaryExpressionWrapper.cs
+1
-1
src/EditorFeatures/Core/Wrapping/BinaryExpression/BinaryExpressionCodeActionComputer.cs
...ng/BinaryExpression/BinaryExpressionCodeActionComputer.cs
+2
-2
未找到文件。
src/EditorFeatures/Core/Implementation/CodeFixes/CodeFixService.cs
浏览文件 @
7c5642ec
...
...
@@ -180,9 +180,9 @@ public async Task<ImmutableArray<CodeFixCollection>> GetFixesAsync(Document docu
var
priorityMap
=
_fixerPriorityMap
[
document
.
Project
.
Language
].
Value
;
result
.
Sort
((
d1
,
d2
)
=>
{
if
(
priorityMap
.
TryGetValue
((
CodeFixProvider
)
d1
.
Provider
,
out
int
priority1
))
if
(
priorityMap
.
TryGetValue
((
CodeFixProvider
)
d1
.
Provider
,
out
var
priority1
))
{
if
(
priorityMap
.
TryGetValue
((
CodeFixProvider
)
d2
.
Provider
,
out
int
priority2
))
if
(
priorityMap
.
TryGetValue
((
CodeFixProvider
)
d2
.
Provider
,
out
var
priority2
))
{
return
priority1
-
priority2
;
}
...
...
@@ -256,7 +256,7 @@ public async Task<Document> ApplyCodeFixesForSpecificDiagnosticIdAsync(Document
ArrayBuilder
<
CodeFixCollection
>
result
,
CancellationToken
cancellationToken
)
{
bool
hasAnySharedFixer
=
_workspaceFixersMap
.
TryGetValue
(
document
.
Project
.
Language
,
out
var
fixerMap
);
var
hasAnySharedFixer
=
_workspaceFixersMap
.
TryGetValue
(
document
.
Project
.
Language
,
out
var
fixerMap
);
var
projectFixersMap
=
GetProjectFixers
(
document
.
Project
);
var
hasAnyProjectFixer
=
projectFixersMap
.
Any
();
...
...
@@ -269,7 +269,7 @@ public async Task<Document> ApplyCodeFixesForSpecificDiagnosticIdAsync(Document
var
allFixers
=
new
List
<
CodeFixProvider
>();
// TODO (https://github.com/dotnet/roslyn/issues/4932): Don't restrict CodeFixes in Interactive
bool
isInteractive
=
document
.
Project
.
Solution
.
Workspace
.
Kind
==
WorkspaceKind
.
Interactive
;
var
isInteractive
=
document
.
Project
.
Solution
.
Workspace
.
Kind
==
WorkspaceKind
.
Interactive
;
foreach
(
var
diagnosticId
in
diagnostics
.
Select
(
d
=>
d
.
Id
).
Distinct
())
{
...
...
src/EditorFeatures/Core/Implementation/Commands/CommandHandlerService.cs
浏览文件 @
7c5642ec
...
...
@@ -83,11 +83,11 @@ void ICommandHandlerService.Execute<T>(IContentType contentType, T args, Action
{
// Build up chain of handlers.
var
handlerChain
=
lastHandler
??
delegate
{
};
for
(
int
i
=
commandHandlers
.
Count
-
1
;
i
>=
1
;
i
--)
for
(
var
i
=
commandHandlers
.
Count
-
1
;
i
>=
1
;
i
--)
{
// Declare locals to ensure that we don't end up capturing the wrong thing
var
nextHandler
=
handlerChain
;
int
j
=
i
;
var
j
=
i
;
handlerChain
=
()
=>
commandHandlers
[
j
].
ExecuteCommand
(
args
,
nextHandler
);
}
...
...
@@ -117,11 +117,11 @@ void ICommandHandlerService.Execute<T>(IContentType contentType, T args, Action
{
// Build up chain of handlers.
var
handlerChain
=
lastHandler
??
delegate
{
return
default
;
};
for
(
int
i
=
commandHandlers
.
Count
-
1
;
i
>=
1
;
i
--)
for
(
var
i
=
commandHandlers
.
Count
-
1
;
i
>=
1
;
i
--)
{
// Declare locals to ensure that we don't end up capturing the wrong thing
var
nextHandler
=
handlerChain
;
int
j
=
i
;
var
j
=
i
;
handlerChain
=
()
=>
commandHandlers
[
j
].
GetCommandState
(
args
,
nextHandler
);
}
...
...
src/EditorFeatures/Core/Implementation/DocumentationComments/AbstractDocumentationCommentCommandHandler.cs
浏览文件 @
7c5642ec
...
...
@@ -123,7 +123,7 @@ private TMemberNode GetTargetMember(TDocumentationComment documentationComment)
private
void
AddLineBreaks
(
SourceText
text
,
IList
<
string
>
lines
,
string
newLine
)
{
for
(
int
i
=
0
;
i
<
lines
.
Count
;
i
++)
for
(
var
i
=
0
;
i
<
lines
.
Count
;
i
++)
{
lines
[
i
]
=
lines
[
i
]
+
newLine
;
}
...
...
@@ -189,7 +189,7 @@ private void AddLineBreaks(SourceText text, IList<string> lines, string newLine)
// Add indents
var
lineOffset
=
line
.
GetColumnOfFirstNonWhitespaceCharacterOrEndOfLine
(
options
.
GetOption
(
FormattingOptions
.
TabSize
));
var
indentText
=
lineOffset
.
CreateIndentationString
(
options
.
GetOption
(
FormattingOptions
.
UseTabs
),
options
.
GetOption
(
FormattingOptions
.
TabSize
));
for
(
int
i
=
1
;
i
<
lines
.
Count
-
1
;
i
++)
for
(
var
i
=
1
;
i
<
lines
.
Count
-
1
;
i
++)
{
lines
[
i
]
=
indentText
+
lines
[
i
];
}
...
...
@@ -290,7 +290,7 @@ private void AddLineBreaks(SourceText text, IList<string> lines, string newLine)
// Add indents
var
lineOffset
=
line
.
GetColumnOfFirstNonWhitespaceCharacterOrEndOfLine
(
options
.
GetOption
(
FormattingOptions
.
TabSize
));
var
indentText
=
lineOffset
.
CreateIndentationString
(
options
.
GetOption
(
FormattingOptions
.
UseTabs
),
options
.
GetOption
(
FormattingOptions
.
TabSize
));
for
(
int
i
=
1
;
i
<
lines
.
Count
;
i
++)
for
(
var
i
=
1
;
i
<
lines
.
Count
;
i
++)
{
lines
[
i
]
=
indentText
+
lines
[
i
];
}
...
...
@@ -424,7 +424,7 @@ private void AddLineBreaks(SourceText text, IList<string> lines, string newLine)
Debug
.
Assert
(
line
.
Start
+
lineOffset
==
startPosition
);
var
indentText
=
lineOffset
.
CreateIndentationString
(
options
.
GetOption
(
FormattingOptions
.
UseTabs
),
options
.
GetOption
(
FormattingOptions
.
TabSize
));
for
(
int
i
=
1
;
i
<
lines
.
Count
;
i
++)
for
(
var
i
=
1
;
i
<
lines
.
Count
;
i
++)
{
lines
[
i
]
=
indentText
+
lines
[
i
];
}
...
...
@@ -496,7 +496,7 @@ public bool ExecuteCommand(ReturnKeyCommandArgs args, CommandExecutionContext co
// Check to see if the current line starts with exterior trivia. If so, we'll take over.
// If not, let the nextHandler run.
int
originalPosition
=
-
1
;
var
originalPosition
=
-
1
;
// The original position should be a position that is consistent with the syntax tree, even
// after Enter is pressed. Thus, we use the start of the first selection if there is one.
...
...
src/EditorFeatures/Core/Implementation/EditAndContinue/ActiveStatementTagger.cs
浏览文件 @
7c5642ec
...
...
@@ -84,7 +84,7 @@ public IEnumerable<ITagSpan<ITextMarkerTag>> GetTags(NormalizedSnapshotSpanColle
var
snapshot
=
spans
.
First
().
Snapshot
;
foreach
(
ActiveStatementTextSpan
asSpan
in
service
.
GetSpans
(
snapshot
.
AsText
()))
foreach
(
var
asSpan
in
service
.
GetSpans
(
snapshot
.
AsText
()))
{
if
(
asSpan
.
IsLeaf
)
{
...
...
src/EditorFeatures/Core/Implementation/EditAndContinue/ActiveStatementTrackingService.cs
浏览文件 @
7c5642ec
...
...
@@ -158,7 +158,7 @@ private async Task DocumentOpenedAsync(Document document)
TrackActiveSpansNoLock
(
document
,
snapshot
,
documentActiveStatements
);
}
bool
leafChanged
=
documentActiveStatements
.
Contains
(
s
=>
s
.
IsLeaf
);
var
leafChanged
=
documentActiveStatements
.
Contains
(
s
=>
s
.
IsLeaf
);
_service
.
OnTrackingSpansChanged
(
leafChanged
);
}
}
...
...
@@ -260,7 +260,7 @@ private async Task RefreshTrackingSpansAsync(Document document, ITextSnapshot sn
private
void
RefreshTrackingSpans
(
DocumentId
documentId
,
ITextSnapshot
snapshot
,
ImmutableArray
<
ActiveStatement
>
documentActiveStatements
)
{
bool
updated
=
false
;
var
updated
=
false
;
lock
(
_trackingSpans
)
{
if
(
_trackingSpans
.
TryGetValue
(
documentId
,
out
var
documentTrackingSpans
)
&&
documentTrackingSpans
==
null
)
...
...
@@ -284,7 +284,7 @@ private void SetTrackingSpansNoLock(DocumentId documentId, ActiveStatementTracki
private
static
ActiveStatementTrackingSpan
[]
CreateTrackingSpans
(
ITextSnapshot
snapshot
,
ImmutableArray
<
ActiveStatement
>
documentActiveStatements
)
{
var
result
=
new
ActiveStatementTrackingSpan
[
documentActiveStatements
.
Length
];
for
(
int
i
=
0
;
i
<
result
.
Length
;
i
++)
for
(
var
i
=
0
;
i
<
result
.
Length
;
i
++)
{
var
span
=
snapshot
.
GetTextSpan
(
documentActiveStatements
[
i
].
Span
).
ToSpan
();
result
[
i
]
=
CreateTrackingSpan
(
snapshot
,
span
,
documentActiveStatements
[
i
].
Flags
);
...
...
@@ -354,7 +354,7 @@ public IEnumerable<ActiveStatementTextSpan> GetSpans(SourceText source)
}
var
result
=
new
ActiveStatementTextSpan
[
documentTrackingSpans
.
Length
];
for
(
int
i
=
0
;
i
<
documentTrackingSpans
.
Length
;
i
++)
for
(
var
i
=
0
;
i
<
documentTrackingSpans
.
Length
;
i
++)
{
Debug
.
Assert
(
documentTrackingSpans
[
i
].
Span
.
TextBuffer
==
snapshot
.
TextBuffer
);
...
...
@@ -368,8 +368,8 @@ public IEnumerable<ActiveStatementTextSpan> GetSpans(SourceText source)
public
void
UpdateActiveStatementSpans
(
SourceText
source
,
IEnumerable
<(
ActiveStatementId
,
ActiveStatementTextSpan
)>
spans
)
{
bool
leafUpdated
=
false
;
bool
updated
=
false
;
var
leafUpdated
=
false
;
var
updated
=
false
;
lock
(
_trackingSpans
)
{
foreach
(
var
(
id
,
span
)
in
spans
)
...
...
src/EditorFeatures/Core/Implementation/EditAndContinue/ReadOnlyDocumentTracker.cs
浏览文件 @
7c5642ec
...
...
@@ -81,7 +81,7 @@ private void TrackDocument(DocumentId documentId)
private
bool
IsRegionReadOnly
(
DocumentId
documentId
,
bool
isEdit
)
{
AssertIsForeground
();
bool
isReadOnly
=
_encService
.
IsProjectReadOnly
(
documentId
.
ProjectId
,
out
var
sessionReason
,
out
var
projectReason
);
var
isReadOnly
=
_encService
.
IsProjectReadOnly
(
documentId
.
ProjectId
,
out
var
sessionReason
,
out
var
projectReason
);
if
(
isEdit
&&
isReadOnly
)
{
...
...
src/EditorFeatures/Core/Implementation/ExtractMethod/AbstractExtractMethodCommandHandler.cs
浏览文件 @
7c5642ec
...
...
@@ -208,7 +208,7 @@ private bool TryNotifyFailureToUser(Document document, ExtractMethodResult resul
private
static
ExtractMethodResult
TryWithoutMakingValueTypesRef
(
Document
document
,
NormalizedSnapshotSpanCollection
spans
,
ExtractMethodResult
result
,
CancellationToken
cancellationToken
)
{
OptionSet
options
=
document
.
Project
.
Solution
.
Options
;
var
options
=
document
.
Project
.
Solution
.
Options
;
if
(
options
.
GetOption
(
ExtractMethodOptions
.
DontPutOutOrRefOnStruct
,
document
.
Project
.
Language
)
||
!
result
.
Reasons
.
IsSingle
())
{
...
...
src/EditorFeatures/Core/Implementation/Formatting/Indentation/AbstractSmartTokenFormatterCommandHandler.cs
浏览文件 @
7c5642ec
...
...
@@ -209,8 +209,8 @@ private void HandleOurselves(ITextView view, ITextBuffer subjectBuffer, int inde
private
int
GetOffsetFromIndentation
(
int
indentation
,
IEditorOptions
option
)
{
int
numberOfTabs
=
0
;
int
numberOfSpaces
=
Math
.
Max
(
0
,
indentation
);
var
numberOfTabs
=
0
;
var
numberOfSpaces
=
Math
.
Max
(
0
,
indentation
);
if
(!
option
.
IsConvertTabsToSpacesEnabled
())
{
...
...
src/EditorFeatures/Core/Implementation/IntelliSense/AsyncCompletion/CommitManager.cs
浏览文件 @
7c5642ec
...
...
@@ -166,7 +166,7 @@ internal CommitManager(ITextView textView, RecentItemsManager recentItemsManager
}
// Commit with completion service assumes that null is provided is case of invoke. VS provides '\0' in the case.
char
?
commitChar
=
typeChar
==
'\0'
?
null
:
(
char
?)
typeChar
;
var
commitChar
=
typeChar
==
'\0'
?
null
:
(
char
?)
typeChar
;
var
commitBehavior
=
Commit
(
triggerDocument
,
completionService
,
session
.
TextView
,
subjectBuffer
,
roslynItem
,
completionListSpan
,
commitChar
,
triggerSnapshot
,
serviceRules
,
...
...
src/EditorFeatures/Core/Implementation/IntelliSense/AsyncCompletion/ItemManager.cs
浏览文件 @
7c5642ec
...
...
@@ -281,7 +281,7 @@ private static bool IsAfterDot(ITextSnapshot snapshot, ITrackingSpan applicableT
// Of the items the service returned, pick the one most recently committed
var
bestItem
=
GetBestCompletionItemBasedOnMRU
(
chosenItems
,
recentItems
);
VSCompletionItem
uniqueItem
=
null
;
int
selectedItemIndex
=
0
;
var
selectedItemIndex
=
0
;
// Determine if we should consider this item 'unique' or not. A unique item
// will be automatically committed if the user hits the 'invoke completion'
...
...
@@ -319,7 +319,7 @@ private static bool IsAfterDot(ITextSnapshot snapshot, ITrackingSpan applicableT
return
null
;
}
bool
isHardSelection
=
IsHardSelection
(
var
isHardSelection
=
IsHardSelection
(
filterText
,
initialRoslynTriggerKind
,
bestOrFirstCompletionItem
,
completionHelper
,
filterReason
,
recentItems
,
hasSuggestedItemOptions
);
...
...
src/EditorFeatures/Core/Implementation/IntelliSense/Completion/Controller.Session_FilterModel.cs
浏览文件 @
7c5642ec
...
...
@@ -300,7 +300,7 @@ private bool IsAfterDot(Model model)
}
FilterResult
?
bestFilterResult
=
null
;
int
matchCount
=
0
;
var
matchCount
=
0
;
foreach
(
var
currentFilterResult
in
filterResults
.
Where
(
r
=>
r
.
MatchedFilterText
))
{
if
(
bestFilterResult
==
null
||
...
...
@@ -374,7 +374,7 @@ private bool IsAfterDot(Model model)
}
private
static
bool
IsAllDigits
(
string
filterText
)
{
for
(
int
i
=
0
;
i
<
filterText
.
Length
;
i
++)
for
(
var
i
=
0
;
i
<
filterText
.
Length
;
i
++)
{
if
(
filterText
[
i
]
<
'0'
||
filterText
[
i
]
>
'9'
)
{
...
...
src/EditorFeatures/Core/Implementation/IntelliSense/Completion/Controller.cs
浏览文件 @
7c5642ec
...
...
@@ -256,7 +256,7 @@ private void CommitItem(RoslynCompletionItem item)
public
void
MakeMostRecentItem
(
string
item
)
{
bool
updated
=
false
;
var
updated
=
false
;
while
(!
updated
)
{
...
...
src/EditorFeatures/Core/Implementation/IntelliSense/Completion/Controller_ToggleCompletionMode.cs
浏览文件 @
7c5642ec
...
...
@@ -25,7 +25,7 @@ void IChainedCommandHandler<ToggleCompletionModeCommandArgs>.ExecuteCommand(Togg
{
if
(
Workspace
.
TryGetWorkspace
(
args
.
SubjectBuffer
.
AsTextContainer
(),
out
var
workspace
))
{
Option
<
bool
>
option
=
_isDebugger
var
option
=
_isDebugger
?
EditorCompletionOptions
.
UseSuggestionMode_Debugger
:
EditorCompletionOptions
.
UseSuggestionMode
;
...
...
src/EditorFeatures/Core/Implementation/IntelliSense/Completion/PrioritizedTaskScheduler.cs
浏览文件 @
7c5642ec
...
...
@@ -32,7 +32,7 @@ private void ThreadStart()
while
(
true
)
{
var
task
=
_tasks
.
Take
();
bool
ret
=
this
.
TryExecuteTask
(
task
);
var
ret
=
this
.
TryExecuteTask
(
task
);
Debug
.
Assert
(
ret
);
}
}
...
...
src/EditorFeatures/Core/Implementation/IntelliSense/SignatureHelp/Controller.Session_ComputeModel.cs
浏览文件 @
7c5642ec
...
...
@@ -99,7 +99,7 @@ internal partial class Session
return
currentModel
;
}
var
selectedItem
=
GetSelectedItem
(
currentModel
,
items
,
provider
,
out
bool
userSelected
);
var
selectedItem
=
GetSelectedItem
(
currentModel
,
items
,
provider
,
out
var
userSelected
);
var
model
=
new
Model
(
disconnectedBufferGraph
,
items
.
ApplicableSpan
,
provider
,
items
.
Items
,
selectedItem
,
items
.
ArgumentIndex
,
items
.
ArgumentCount
,
items
.
ArgumentName
,
...
...
src/EditorFeatures/Core/Implementation/IntelliSense/SignatureHelp/Presentation/Signature.cs
浏览文件 @
7c5642ec
...
...
@@ -121,7 +121,7 @@ private void Initialize()
var
paramColumnCount
=
0
;
for
(
int
i
=
0
;
i
<
_signatureHelpItem
.
Parameters
.
Length
;
i
++)
for
(
var
i
=
0
;
i
<
_signatureHelpItem
.
Parameters
.
Length
;
i
++)
{
var
sigHelpParameter
=
_signatureHelpItem
.
Parameters
[
i
];
...
...
src/EditorFeatures/Core/Implementation/NavigationBar/NavigationBarController_ModelComputation.cs
浏览文件 @
7c5642ec
...
...
@@ -177,9 +177,9 @@ internal static NavigationBarSelectedTypeAndMember ComputeSelectedTypeAndMember(
private
static
(
T
item
,
bool
gray
)
GetMatchingItem
<
T
>(
IEnumerable
<
T
>
items
,
SnapshotPoint
point
,
INavigationBarItemService
itemsService
,
CancellationToken
cancellationToken
)
where
T
:
NavigationBarItem
{
T
exactItem
=
null
;
int
exactItemStart
=
0
;
var
exactItemStart
=
0
;
T
nextItem
=
null
;
int
nextItemStart
=
int
.
MaxValue
;
var
nextItemStart
=
int
.
MaxValue
;
foreach
(
var
item
in
items
)
{
...
...
src/EditorFeatures/Core/Implementation/Peek/DefinitionPeekableItem.cs
浏览文件 @
7c5642ec
...
...
@@ -79,7 +79,7 @@ public void FindResults(string relationshipName, IPeekResultCollection resultCol
resultCollection
.
Add
(
PeekHelpers
.
CreateDocumentPeekResult
(
declarationFile
.
FilePath
,
identifierSpan
,
entityOfInterestSpan
,
peekDisplayInfo
,
_peekableItem
.
PeekResultFactory
,
isReadOnly
:
true
));
}
int
processedSourceLocations
=
0
;
var
processedSourceLocations
=
0
;
foreach
(
var
declaration
in
sourceLocations
)
{
...
...
src/EditorFeatures/Core/Implementation/RenameTracking/RenameTrackingTaggerProvider.RenameTrackingCommitter.cs
浏览文件 @
7c5642ec
...
...
@@ -50,7 +50,7 @@ public void Commit(CancellationToken cancellationToken)
{
AssertIsForeground
();
bool
clearTrackingSession
=
ApplyChangesToWorkspace
(
cancellationToken
);
var
clearTrackingSession
=
ApplyChangesToWorkspace
(
cancellationToken
);
// Clear the state machine so that future updates to the same token work,
// and any text changes caused by this update are not interpreted as
...
...
src/EditorFeatures/Core/Implementation/RenameTracking/RenameTrackingTaggerProvider.StateMachine.cs
浏览文件 @
7c5642ec
...
...
@@ -103,7 +103,7 @@ private void Buffer_Changed(object sender, TextContentChangedEventArgs e)
// There's an existing session. Continue that session if the current change is
// contained inside the tracking span.
SnapshotSpan
trackingSpanInNewSnapshot
=
this
.
TrackingSession
.
TrackingSpan
.
GetSpan
(
e
.
After
);
var
trackingSpanInNewSnapshot
=
this
.
TrackingSession
.
TrackingSpan
.
GetSpan
(
e
.
After
);
if
(
trackingSpanInNewSnapshot
.
Contains
(
change
.
NewSpan
))
{
// Continuing an existing tracking session. If there may have been a tag
...
...
@@ -166,8 +166,8 @@ private void StartTrackingSession(TextContentChangedEventArgs eventArgs)
return
;
}
int
leftSidePosition
=
change
.
OldPosition
;
int
rightSidePosition
=
change
.
OldPosition
+
change
.
OldText
.
Length
;
var
leftSidePosition
=
change
.
OldPosition
;
var
rightSidePosition
=
change
.
OldPosition
+
change
.
OldText
.
Length
;
while
(
leftSidePosition
>
0
&&
IsTrackableCharacter
(
syntaxFactsService
,
beforeText
[
leftSidePosition
-
1
]))
{
...
...
@@ -294,7 +294,7 @@ internal Diagnostic TryGetDiagnostic(SyntaxTree tree, DiagnosticDescriptor diagn
if
(
CanInvokeRename
(
out
var
trackingSession
,
waitForResult
:
true
,
cancellationToken
:
cancellationToken
))
{
SnapshotSpan
snapshotSpan
=
trackingSession
.
TrackingSpan
.
GetSpan
(
Buffer
.
CurrentSnapshot
);
var
snapshotSpan
=
trackingSession
.
TrackingSpan
.
GetSpan
(
Buffer
.
CurrentSnapshot
);
var
textSpan
=
snapshotSpan
.
Span
.
ToTextSpan
();
var
builder
=
ImmutableDictionary
.
CreateBuilder
<
string
,
string
>();
...
...
src/EditorFeatures/Core/Implementation/TextStructureNavigation/AbstractTextStructureNavigatorProvider.TextStructureNavigator.cs
浏览文件 @
7c5642ec
...
...
@@ -208,7 +208,7 @@ private SnapshotSpan GetSpanOfNextSiblingWorker(SnapshotSpan activeSpan, Cancell
if
(
parent
!=
null
)
{
// Find node immediately after the current in the children collection.
SyntaxNodeOrToken
?
nodeOrToken
=
parent
.
Value
var
nodeOrToken
=
parent
.
Value
.
ChildNodesAndTokens
()
.
SkipWhile
(
child
=>
child
!=
node
)
.
Skip
(
1
)
...
...
@@ -259,7 +259,7 @@ private SnapshotSpan GetSpanOfPreviousSiblingWorker(SnapshotSpan activeSpan, Can
if
(
parent
!=
null
)
{
// Find node immediately before the current in the children collection.
SyntaxNodeOrToken
?
nodeOrToken
=
parent
.
Value
var
nodeOrToken
=
parent
.
Value
.
ChildNodesAndTokens
()
.
Reverse
()
.
SkipWhile
(
child
=>
child
!=
node
)
...
...
src/EditorFeatures/Core/Shared/Extensions/IProjectionBufferFactoryServiceExtensions.cs
浏览文件 @
7c5642ec
...
...
@@ -329,7 +329,7 @@ private static IList<IList<SnapshotSpan>> CreateSnapshotSpanRanges(ITextSnapshot
private
static
IList
<
SnapshotSpan
>
CreateSnapshotSpans
(
ITextSnapshot
snapshot
,
LineSpan
lineSpan
)
{
var
result
=
new
List
<
SnapshotSpan
>();
for
(
int
i
=
lineSpan
.
Start
;
i
<
lineSpan
.
End
;
i
++)
for
(
var
i
=
lineSpan
.
Start
;
i
<
lineSpan
.
End
;
i
++)
{
var
line
=
snapshot
.
GetLineFromLineNumber
(
i
);
result
.
Add
(
line
.
Extent
);
...
...
src/EditorFeatures/Core/Shared/Tagging/Utilities/TagSpanIntervalTree.cs
浏览文件 @
7c5642ec
...
...
@@ -126,7 +126,7 @@ private IEnumerable<ITagSpan<TTag>> GetTagsForLargeNumberOfSpans(NormalizedSnaps
var
mergedSpan
=
new
SnapshotSpan
(
requestedSpans
[
0
].
Start
,
requestedSpans
[
requestedSpans
.
Count
-
1
].
End
);
var
result
=
GetIntersectingSpans
(
mergedSpan
);
int
requestIndex
=
0
;
var
requestIndex
=
0
;
var
enumerator
=
result
.
GetEnumerator
();
...
...
src/EditorFeatures/Core/Shared/Utilities/ForegroundThreadAffinitizedObject.cs
浏览文件 @
7c5642ec
...
...
@@ -109,7 +109,7 @@ protected bool IsInputPending()
// The return value of GetQueueStatus is HIWORD:LOWORD.
// A non-zero value in HIWORD indicates some input message in the queue.
uint
result
=
NativeMethods
.
GetQueueStatus
(
NativeMethods
.
QS_INPUT
);
var
result
=
NativeMethods
.
GetQueueStatus
(
NativeMethods
.
QS_INPUT
);
const
uint
InputMask
=
NativeMethods
.
QS_INPUT
|
(
NativeMethods
.
QS_INPUT
<<
16
);
return
(
result
&
InputMask
)
!=
0
;
...
...
src/EditorFeatures/Core/Shared/Utilities/HACK_TextUndoTransactionThatRollsBackProperly.cs
浏览文件 @
7c5642ec
...
...
@@ -73,7 +73,7 @@ public void AddUndo(ITextUndoPrimitive undo)
public
void
Cancel
()
{
bool
transactionWasOpen
=
_transactionOpen
;
var
transactionWasOpen
=
_transactionOpen
;
_transactionOpen
=
false
;
// First, add an undo primitive so we can detect whether or not undo gets called
...
...
src/EditorFeatures/Core/Tagging/AbstractAsynchronousTaggerProvider.TagSource_ProduceTags.cs
浏览文件 @
7c5642ec
...
...
@@ -143,7 +143,7 @@ private void AccumulateTextChanges(TextContentChangedEventArgs contentChanged)
default
:
var
textChangeRanges
=
new
TextChangeRange
[
count
];
for
(
int
i
=
0
;
i
<
count
;
i
++)
for
(
var
i
=
0
;
i
<
count
;
i
++)
{
var
c
=
contentChanges
[
i
];
textChangeRanges
[
i
]
=
new
TextChangeRange
(
new
TextSpan
(
c
.
OldSpan
.
Start
,
c
.
OldSpan
.
Length
),
c
.
NewLength
);
...
...
src/EditorFeatures/Core/Wrapping/BinaryExpression/AbstractBinaryExpressionWrapper.cs
浏览文件 @
7c5642ec
...
...
@@ -61,7 +61,7 @@ internal abstract partial class AbstractBinaryExpressionWrapper<TBinaryExpressio
#if DEBUG
Debug
.
Assert
(
exprsAndOperators
.
Length
>=
3
);
Debug
.
Assert
(
exprsAndOperators
.
Length
%
2
==
1
,
"Should have odd number of exprs and operators"
);
for
(
int
i
=
0
;
i
<
exprsAndOperators
.
Length
;
i
++)
for
(
var
i
=
0
;
i
<
exprsAndOperators
.
Length
;
i
++)
{
var
item
=
exprsAndOperators
[
i
];
Debug
.
Assert
(((
i
%
2
)
==
0
&&
item
.
IsNode
)
||
...
...
src/EditorFeatures/Core/Wrapping/BinaryExpression/BinaryExpressionCodeActionComputer.cs
浏览文件 @
7c5642ec
...
...
@@ -79,7 +79,7 @@ private ImmutableArray<Edit> GetWrapEdits(bool align)
var
result
=
ArrayBuilder
<
Edit
>.
GetInstance
();
var
indentationTrivia
=
align
?
_indentAndAlignTrivia
:
_smartIndentTrivia
;
for
(
int
i
=
1
;
i
<
_exprsAndOperators
.
Length
;
i
+=
2
)
for
(
var
i
=
1
;
i
<
_exprsAndOperators
.
Length
;
i
+=
2
)
{
var
left
=
_exprsAndOperators
[
i
-
1
].
AsNode
();
var
opToken
=
_exprsAndOperators
[
i
].
AsToken
();
...
...
@@ -114,7 +114,7 @@ private ImmutableArray<Edit> GetUnwrapEdits()
{
var
result
=
ArrayBuilder
<
Edit
>.
GetInstance
();
for
(
int
i
=
0
;
i
<
_exprsAndOperators
.
Length
-
1
;
i
++)
for
(
var
i
=
0
;
i
<
_exprsAndOperators
.
Length
-
1
;
i
++)
{
result
.
Add
(
Edit
.
UpdateBetween
(
_exprsAndOperators
[
i
],
SingleWhitespaceTrivia
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录