Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
955d08a2
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,发现更多精彩内容 >>
提交
955d08a2
编写于
5月 21, 2019
作者:
C
Cyrus Najmabadi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use var
上级
7f421eeb
变更
17
隐藏空白更改
内联
并排
Showing
17 changed file
with
45 addition
and
45 deletion
+45
-45
src/EditorFeatures/Core.Wpf/InlineRename/CommandHandlers/RenameCommandHandler_TabHandler.cs
...Rename/CommandHandlers/RenameCommandHandler_TabHandler.cs
+3
-3
src/EditorFeatures/Core.Wpf/InlineRename/CommandHandlers/RenameCommandHandler_UndoRedoHandler.cs
...e/CommandHandlers/RenameCommandHandler_UndoRedoHandler.cs
+2
-2
src/EditorFeatures/Core.Wpf/InlineRename/Dashboard/Dashboard.xaml.cs
...eatures/Core.Wpf/InlineRename/Dashboard/Dashboard.xaml.cs
+3
-3
src/EditorFeatures/Core.Wpf/InlineRename/Dashboard/DashboardViewModel.cs
...res/Core.Wpf/InlineRename/Dashboard/DashboardViewModel.cs
+2
-2
src/EditorFeatures/Core.Wpf/InlineRename/Dashboard/RenameShortcutKeys.cs
...res/Core.Wpf/InlineRename/Dashboard/RenameShortcutKeys.cs
+1
-1
src/EditorFeatures/Core.Wpf/InlineRename/InlineRenameSession.OpenTextBufferManager.cs
...InlineRename/InlineRenameSession.OpenTextBufferManager.cs
+3
-3
src/EditorFeatures/Core.Wpf/InlineRename/InlineRenameSession.cs
...itorFeatures/Core.Wpf/InlineRename/InlineRenameSession.cs
+2
-2
src/EditorFeatures/Core.Wpf/Interactive/CSharpVBResetCommand.cs
...itorFeatures/Core.Wpf/Interactive/CSharpVBResetCommand.cs
+5
-5
src/EditorFeatures/Core.Wpf/Interactive/InteractiveCommandHandler.cs
...eatures/Core.Wpf/Interactive/InteractiveCommandHandler.cs
+1
-1
src/EditorFeatures/Core.Wpf/Interactive/InteractiveGlobalUndoServiceFactory.cs
...re.Wpf/Interactive/InteractiveGlobalUndoServiceFactory.cs
+1
-1
src/EditorFeatures/Core.Wpf/Interactive/InteractivePasteCommandHandler.cs
...es/Core.Wpf/Interactive/InteractivePasteCommandHandler.cs
+5
-5
src/EditorFeatures/Core.Wpf/Interactive/ReplCommandCompletionProvider.cs
...res/Core.Wpf/Interactive/ReplCommandCompletionProvider.cs
+3
-3
src/EditorFeatures/Core.Wpf/Interactive/ResetInteractive.cs
src/EditorFeatures/Core.Wpf/Interactive/ResetInteractive.cs
+2
-2
src/EditorFeatures/Core.Wpf/Interactive/SendToInteractiveSubmissionProvider.cs
...re.Wpf/Interactive/SendToInteractiveSubmissionProvider.cs
+7
-7
src/EditorFeatures/Core.Wpf/Options/LegacyEditorConfigDocumentOptionsProvider.DocumentOptions.cs
...acyEditorConfigDocumentOptionsProvider.DocumentOptions.cs
+1
-1
src/EditorFeatures/Core.Wpf/Suggestions/SuggestedActions/SuggestedAction.cs
.../Core.Wpf/Suggestions/SuggestedActions/SuggestedAction.cs
+1
-1
src/EditorFeatures/Core.Wpf/SymbolSearch/Patching/Delta.cs
src/EditorFeatures/Core.Wpf/SymbolSearch/Patching/Delta.cs
+3
-3
未找到文件。
src/EditorFeatures/Core.Wpf/InlineRename/CommandHandlers/RenameCommandHandler_TabHandler.cs
浏览文件 @
955d08a2
...
...
@@ -23,7 +23,7 @@ public VSCommanding.CommandState GetCommandState(TabKeyCommandArgs args, Func<VS
public
void
ExecuteCommand
(
TabKeyCommandArgs
args
,
Action
nextHandler
,
CommandExecutionContext
context
)
{
// If the Dashboard is focused, just navigate through its UI.
Dashboard
dashboard
=
GetDashboard
(
args
.
TextView
);
var
dashboard
=
GetDashboard
(
args
.
TextView
);
if
(
dashboard
!=
null
&&
dashboard
.
ShouldReceiveKeyboardNavigation
)
{
dashboard
.
FocusNextElement
();
...
...
@@ -36,11 +36,11 @@ public void ExecuteCommand(TabKeyCommandArgs args, Action nextHandler, CommandEx
_renameService
.
ActiveSession
.
GetBufferManager
(
args
.
SubjectBuffer
)
.
GetEditableSpansForSnapshot
(
args
.
SubjectBuffer
.
CurrentSnapshot
));
for
(
int
i
=
0
;
i
<
spans
.
Count
;
i
++)
for
(
var
i
=
0
;
i
<
spans
.
Count
;
i
++)
{
if
(
span
==
spans
[
i
])
{
int
selectNext
=
i
<
spans
.
Count
-
1
?
i
+
1
:
0
;
var
selectNext
=
i
<
spans
.
Count
-
1
?
i
+
1
:
0
;
var
newSelection
=
spans
[
selectNext
];
args
.
TextView
.
TryMoveCaretToAndEnsureVisible
(
newSelection
.
Start
);
args
.
TextView
.
SetSelection
(
newSelection
);
...
...
src/EditorFeatures/Core.Wpf/InlineRename/CommandHandlers/RenameCommandHandler_UndoRedoHandler.cs
浏览文件 @
955d08a2
...
...
@@ -24,7 +24,7 @@ public bool ExecuteCommand(UndoCommandArgs args, CommandExecutionContext context
{
if
(
_renameService
.
ActiveSession
!=
null
)
{
for
(
int
i
=
0
;
i
<
args
.
Count
&&
_renameService
.
ActiveSession
!=
null
;
i
++)
for
(
var
i
=
0
;
i
<
args
.
Count
&&
_renameService
.
ActiveSession
!=
null
;
i
++)
{
_renameService
.
ActiveSession
.
UndoManager
.
Undo
(
args
.
SubjectBuffer
);
}
...
...
@@ -39,7 +39,7 @@ public bool ExecuteCommand(RedoCommandArgs args, CommandExecutionContext context
{
if
(
_renameService
.
ActiveSession
!=
null
)
{
for
(
int
i
=
0
;
i
<
args
.
Count
&&
_renameService
.
ActiveSession
!=
null
;
i
++)
for
(
var
i
=
0
;
i
<
args
.
Count
&&
_renameService
.
ActiveSession
!=
null
;
i
++)
{
_renameService
.
ActiveSession
.
UndoManager
.
Redo
(
args
.
SubjectBuffer
);
}
...
...
src/EditorFeatures/Core.Wpf/InlineRename/Dashboard/Dashboard.xaml.cs
浏览文件 @
955d08a2
...
...
@@ -185,7 +185,7 @@ private void ConnectToPresentationSource(PresentationSource presentationSource)
if
(
_rootDependencyObject
!=
null
&&
_rootInputElement
!=
null
)
{
foreach
(
string
accessKey
in
_renameAccessKeys
)
foreach
(
var
accessKey
in
_renameAccessKeys
)
{
AccessKeyManager
.
Register
(
accessKey
,
_rootInputElement
);
}
...
...
@@ -196,7 +196,7 @@ private void ConnectToPresentationSource(PresentationSource presentationSource)
private
void
OnAccessKeyPressed
(
object
sender
,
AccessKeyPressedEventArgs
args
)
{
foreach
(
string
accessKey
in
_renameAccessKeys
)
foreach
(
var
accessKey
in
_renameAccessKeys
)
{
if
(
string
.
Compare
(
accessKey
,
args
.
Key
,
StringComparison
.
OrdinalIgnoreCase
)
==
0
)
{
...
...
@@ -243,7 +243,7 @@ private void DisconnectFromPresentationSource()
{
if
(
_rootInputElement
!=
null
)
{
foreach
(
string
registeredKey
in
_renameAccessKeys
)
foreach
(
var
registeredKey
in
_renameAccessKeys
)
{
AccessKeyManager
.
Unregister
(
registeredKey
,
_rootInputElement
);
}
...
...
src/EditorFeatures/Core.Wpf/InlineRename/Dashboard/DashboardViewModel.cs
浏览文件 @
955d08a2
...
...
@@ -52,8 +52,8 @@ public DashboardViewModel(InlineRenameSession session)
private
void
OnReferenceLocationsChanged
(
object
sender
,
ImmutableArray
<
InlineRenameLocation
>
renameLocations
)
{
int
totalFilesCount
=
renameLocations
.
GroupBy
(
s
=>
s
.
Document
).
Count
();
int
totalSpansCount
=
renameLocations
.
Length
;
var
totalFilesCount
=
renameLocations
.
GroupBy
(
s
=>
s
.
Document
).
Count
();
var
totalSpansCount
=
renameLocations
.
Length
;
UpdateSearchText
(
totalSpansCount
,
totalFilesCount
);
}
...
...
src/EditorFeatures/Core.Wpf/InlineRename/Dashboard/RenameShortcutKeys.cs
浏览文件 @
955d08a2
...
...
@@ -27,7 +27,7 @@ static RenameShortcutKey()
/// </summary>
private
static
string
ExtractAccessKey
(
string
localizedLabel
,
string
defaultValue
)
{
int
underscoreIndex
=
localizedLabel
.
IndexOf
(
'_'
);
var
underscoreIndex
=
localizedLabel
.
IndexOf
(
'_'
);
if
(
underscoreIndex
>=
0
&&
underscoreIndex
<
localizedLabel
.
Length
-
1
)
{
...
...
src/EditorFeatures/Core.Wpf/InlineRename/InlineRenameSession.OpenTextBufferManager.cs
浏览文件 @
955d08a2
...
...
@@ -541,7 +541,7 @@ internal void ApplyConflictResolutionEdits(IInlineRenameReplacementInfo conflict
private
static
string
GetWithoutAttributeSuffix
(
string
text
,
bool
isCaseSensitive
)
{
if
(!
text
.
TryGetWithoutAttributeSuffix
(
isCaseSensitive
,
out
string
replaceText
))
if
(!
text
.
TryGetWithoutAttributeSuffix
(
isCaseSensitive
,
out
var
replaceText
))
{
replaceText
=
text
;
}
...
...
@@ -566,8 +566,8 @@ private static async Task<IEnumerable<TextChange>> GetTextChangesFromTextDiffere
throw
new
ArgumentException
(
WorkspacesResources
.
The_specified_document_is_not_a_version_of_this_document
);
}
SourceText
oldText
=
await
oldDocument
.
GetTextAsync
(
cancellationToken
).
ConfigureAwait
(
false
);
SourceText
newText
=
await
newDocument
.
GetTextAsync
(
cancellationToken
).
ConfigureAwait
(
false
);
var
oldText
=
await
oldDocument
.
GetTextAsync
(
cancellationToken
).
ConfigureAwait
(
false
);
var
newText
=
await
newDocument
.
GetTextAsync
(
cancellationToken
).
ConfigureAwait
(
false
);
if
(
oldText
==
newText
)
{
...
...
src/EditorFeatures/Core.Wpf/InlineRename/InlineRenameSession.cs
浏览文件 @
955d08a2
...
...
@@ -183,7 +183,7 @@ private void InitializeOpenBuffers(SnapshotSpan triggerSpan)
{
using
(
Logger
.
LogBlock
(
FunctionId
.
Rename_CreateOpenTextBufferManagerForAllOpenDocs
,
CancellationToken
.
None
))
{
HashSet
<
ITextBuffer
>
openBuffers
=
new
HashSet
<
ITextBuffer
>();
var
openBuffers
=
new
HashSet
<
ITextBuffer
>();
foreach
(
var
d
in
_workspace
.
GetOpenDocumentIds
())
{
var
document
=
_baseSolution
.
GetDocument
(
d
);
...
...
@@ -669,7 +669,7 @@ private void CommitCore(IWaitContext waitContext, bool previewChanges)
_conflictResolutionTask
.
Wait
(
waitContext
.
CancellationToken
);
waitContext
.
AllowCancel
=
false
;
Solution
newSolution
=
_conflictResolutionTask
.
Result
.
NewSolution
;
var
newSolution
=
_conflictResolutionTask
.
Result
.
NewSolution
;
if
(
previewChanges
)
{
var
previewService
=
_workspace
.
Services
.
GetService
<
IPreviewDialogService
>();
...
...
src/EditorFeatures/Core.Wpf/Interactive/CSharpVBResetCommand.cs
浏览文件 @
955d08a2
...
...
@@ -64,7 +64,7 @@ public string CommandLine
public
Task
<
ExecutionResult
>
Execute
(
IInteractiveWindow
window
,
string
arguments
)
{
if
(!
TryParseArguments
(
arguments
,
out
bool
initialize
,
out
bool
?
is64bit
))
if
(!
TryParseArguments
(
arguments
,
out
var
initialize
,
out
var
is64bit
))
{
ReportInvalidArguments
(
window
);
return
ExecutionResult
.
Failed
;
...
...
@@ -77,8 +77,8 @@ public Task<ExecutionResult> Execute(IInteractiveWindow window, string arguments
public
IEnumerable
<
ClassificationSpan
>
ClassifyArguments
(
ITextSnapshot
snapshot
,
Span
argumentsSpan
,
Span
spanToClassify
)
{
string
arguments
=
snapshot
.
GetText
(
argumentsSpan
);
int
argumentsStart
=
argumentsSpan
.
Start
;
var
arguments
=
snapshot
.
GetText
(
argumentsSpan
);
var
argumentsStart
=
argumentsSpan
.
Start
;
foreach
(
var
pos
in
GetNoConfigPositions
(
arguments
))
{
var
snapshotSpan
=
new
SnapshotSpan
(
snapshot
,
new
Span
(
argumentsStart
+
pos
,
s_noConfigParameterNameLength
));
...
...
@@ -90,10 +90,10 @@ public IEnumerable<ClassificationSpan> ClassifyArguments(ITextSnapshot snapshot,
/// </remarks>
internal
static
IEnumerable
<
int
>
GetNoConfigPositions
(
string
arguments
)
{
int
startIndex
=
0
;
var
startIndex
=
0
;
while
(
true
)
{
int
index
=
arguments
.
IndexOf
(
NoConfigParameterName
,
startIndex
,
StringComparison
.
Ordinal
);
var
index
=
arguments
.
IndexOf
(
NoConfigParameterName
,
startIndex
,
StringComparison
.
Ordinal
);
if
(
index
<
0
)
yield
break
;
if
((
index
==
0
||
char
.
IsWhiteSpace
(
arguments
[
index
-
1
]))
&&
...
...
src/EditorFeatures/Core.Wpf/Interactive/InteractiveCommandHandler.cs
浏览文件 @
955d08a2
...
...
@@ -61,7 +61,7 @@ bool VSCommanding.ICommandHandler<ExecuteInInteractiveCommandArgs>.ExecuteComman
var
window
=
OpenInteractiveWindow
(
focus
:
false
);
using
(
context
.
OperationContext
.
AddScope
(
allowCancellation
:
true
,
InteractiveEditorFeaturesResources
.
Executing_selection_in_Interactive_Window
))
{
string
submission
=
GetSelectedText
(
args
,
context
.
OperationContext
.
UserCancellationToken
);
var
submission
=
GetSelectedText
(
args
,
context
.
OperationContext
.
UserCancellationToken
);
if
(!
String
.
IsNullOrWhiteSpace
(
submission
))
{
window
.
SubmitAsync
(
new
string
[]
{
submission
});
...
...
src/EditorFeatures/Core.Wpf/Interactive/InteractiveGlobalUndoServiceFactory.cs
浏览文件 @
955d08a2
...
...
@@ -53,7 +53,7 @@ public IWorkspaceGlobalUndoTransaction OpenGlobalUndoTransaction(Workspace works
throw
new
ArgumentException
(
EditorFeaturesResources
.
Given_Workspace_doesn_t_support_Undo
);
}
ITextUndoHistory
textUndoHistory
=
GetHistory
(
workspace
);
var
textUndoHistory
=
GetHistory
(
workspace
);
var
transaction
=
textUndoHistory
.
CreateTransaction
(
description
);
...
...
src/EditorFeatures/Core.Wpf/Interactive/InteractivePasteCommandHandler.cs
浏览文件 @
955d08a2
...
...
@@ -89,8 +89,8 @@ private void PasteInteractiveFormat(ITextView textView)
var
data
=
RoslynClipboard
.
GetDataObject
();
Debug
.
Assert
(
data
!=
null
);
bool
dataHasLineCutCopyTag
=
false
;
bool
dataHasBoxCutCopyTag
=
false
;
var
dataHasLineCutCopyTag
=
false
;
var
dataHasBoxCutCopyTag
=
false
;
dataHasLineCutCopyTag
=
data
.
GetDataPresent
(
ClipboardLineBasedCutCopyTag
);
dataHasBoxCutCopyTag
=
data
.
GetDataPresent
(
BoxSelectionCutCopyTag
);
...
...
@@ -140,9 +140,9 @@ private void PasteInteractiveFormat(ITextView textView)
private
static
bool
HasNonWhiteSpaceCharacter
(
ITextSnapshotLine
line
)
{
var
snapshot
=
line
.
Snapshot
;
int
start
=
line
.
Start
.
Position
;
int
count
=
line
.
Length
;
for
(
int
i
=
0
;
i
<
count
;
i
++)
var
start
=
line
.
Start
.
Position
;
var
count
=
line
.
Length
;
for
(
var
i
=
0
;
i
<
count
;
i
++)
{
if
(!
char
.
IsWhiteSpace
(
snapshot
[
start
+
i
]))
{
...
...
src/EditorFeatures/Core.Wpf/Interactive/ReplCommandCompletionProvider.cs
浏览文件 @
955d08a2
...
...
@@ -23,7 +23,7 @@ public override async Task ProvideCompletionsAsync(CompletionContext context)
// the provider might be invoked in non-interactive context:
Workspace
ws
;
SourceText
sourceText
=
await
document
.
GetTextAsync
(
cancellationToken
).
ConfigureAwait
(
false
);
var
sourceText
=
await
document
.
GetTextAsync
(
cancellationToken
).
ConfigureAwait
(
false
);
if
(
Workspace
.
TryGetWorkspace
(
sourceText
.
Container
,
out
ws
))
{
if
(
ws
is
InteractiveWorkspace
workspace
)
...
...
@@ -33,14 +33,14 @@ public override async Task ProvideCompletionsAsync(CompletionContext context)
if
(
await
ShouldDisplayCommandCompletionsAsync
(
tree
,
position
,
cancellationToken
).
ConfigureAwait
(
false
))
{
IInteractiveWindowCommands
commands
=
window
.
GetInteractiveCommands
();
var
commands
=
window
.
GetInteractiveCommands
();
if
(
commands
!=
null
)
{
foreach
(
var
command
in
commands
.
GetCommands
())
{
foreach
(
var
commandName
in
command
.
Names
)
{
string
completion
=
GetCompletionString
(
commandName
);
var
completion
=
GetCompletionString
(
commandName
);
context
.
AddItem
(
CommonCompletionItem
.
Create
(
completion
,
displayTextSuffix
:
""
,
CompletionItemRules
.
Default
,
description
:
command
.
Description
.
ToSymbolDisplayParts
(),
glyph
:
Glyph
.
Intrinsic
));
}
...
...
src/EditorFeatures/Core.Wpf/Interactive/ResetInteractive.cs
浏览文件 @
955d08a2
...
...
@@ -39,7 +39,7 @@ internal ResetInteractive(IEditorOptionsFactoryService editorOptionsFactoryServi
internal
Task
Execute
(
IInteractiveWindow
interactiveWindow
,
string
title
)
{
if
(
GetProjectProperties
(
out
var
references
,
out
var
referenceSearchPaths
,
out
var
sourceSearchPaths
,
out
var
projectNamespaces
,
out
var
projectDirectory
,
out
bool
?
is64Bit
))
if
(
GetProjectProperties
(
out
var
references
,
out
var
referenceSearchPaths
,
out
var
sourceSearchPaths
,
out
var
projectNamespaces
,
out
var
projectDirectory
,
out
var
is64Bit
))
{
// Now, we're going to do a bunch of async operations. So create a wait
// indicator so the user knows something is happening, and also so they cancel.
...
...
@@ -114,7 +114,7 @@ internal Task Execute(IInteractiveWindow interactiveWindow, string title)
// Project's default namespace might be different from namespace used within project.
// Filter out namespace imports that do not exist in interactive compilation.
IEnumerable
<
string
>
namespacesToImport
=
await
GetNamespacesToImportAsync
(
projectNamespaces
,
interactiveWindow
).
ConfigureAwait
(
true
);
var
namespacesToImport
=
await
GetNamespacesToImportAsync
(
projectNamespaces
,
interactiveWindow
).
ConfigureAwait
(
true
);
var
importNamespacesCommand
=
namespacesToImport
.
Select
(
_createImport
).
Join
(
editorOptions
.
GetNewLineCharacter
());
if
(!
string
.
IsNullOrWhiteSpace
(
importNamespacesCommand
))
...
...
src/EditorFeatures/Core.Wpf/Interactive/SendToInteractiveSubmissionProvider.cs
浏览文件 @
955d08a2
...
...
@@ -32,7 +32,7 @@ internal abstract class AbstractSendToInteractiveSubmissionProvider : ISendToInt
string
ISendToInteractiveSubmissionProvider
.
GetSelectedText
(
IEditorOptions
editorOptions
,
EditorCommandArgs
args
,
CancellationToken
cancellationToken
)
{
IEnumerable
<
SnapshotSpan
>
selectedSpans
=
args
.
TextView
.
Selection
.
IsEmpty
var
selectedSpans
=
args
.
TextView
.
Selection
.
IsEmpty
?
GetExpandedLineAsync
(
editorOptions
,
args
,
cancellationToken
).
WaitAndGetResult
(
cancellationToken
)
:
args
.
TextView
.
Selection
.
GetSnapshotSpansOnBuffer
(
args
.
SubjectBuffer
).
Where
(
ss
=>
ss
.
Length
>
0
);
...
...
@@ -42,7 +42,7 @@ string ISendToInteractiveSubmissionProvider.GetSelectedText(IEditorOptions edito
/// <summary>Returns the span for the selected line. Extends it if it is a part of a multi line statement or declaration.</summary>
private
Task
<
IEnumerable
<
SnapshotSpan
>>
GetExpandedLineAsync
(
IEditorOptions
editorOptions
,
EditorCommandArgs
args
,
CancellationToken
cancellationToken
)
{
IEnumerable
<
SnapshotSpan
>
selectedSpans
=
GetSelectedLine
(
args
.
TextView
);
var
selectedSpans
=
GetSelectedLine
(
args
.
TextView
);
var
candidateSubmission
=
GetSubmissionFromSelectedSpans
(
editorOptions
,
selectedSpans
);
return
CanParseSubmission
(
candidateSubmission
)
?
Task
.
FromResult
(
selectedSpans
)
...
...
@@ -52,8 +52,8 @@ private Task<IEnumerable<SnapshotSpan>> GetExpandedLineAsync(IEditorOptions edit
/// <summary>Returns the span for the currently selected line.</summary>
private
static
IEnumerable
<
SnapshotSpan
>
GetSelectedLine
(
ITextView
textView
)
{
ITextSnapshotLine
snapshotLine
=
textView
.
Caret
.
Position
.
VirtualBufferPosition
.
Position
.
GetContainingLine
();
SnapshotSpan
span
=
new
SnapshotSpan
(
snapshotLine
.
Start
,
snapshotLine
.
LengthIncludingLineBreak
);
var
snapshotLine
=
textView
.
Caret
.
Position
.
VirtualBufferPosition
.
Position
.
GetContainingLine
();
var
span
=
new
SnapshotSpan
(
snapshotLine
.
Start
,
snapshotLine
.
LengthIncludingLineBreak
);
return
new
NormalizedSnapshotSpanCollection
(
span
);
}
...
...
@@ -63,7 +63,7 @@ private static IEnumerable<SnapshotSpan> GetSelectedLine(ITextView textView)
ITextSnapshot
snapshot
,
CancellationToken
cancellationToken
)
{
Document
doc
=
args
.
SubjectBuffer
.
CurrentSnapshot
.
GetOpenDocumentInCurrentContextWithChanges
();
var
doc
=
args
.
SubjectBuffer
.
CurrentSnapshot
.
GetOpenDocumentInCurrentContextWithChanges
();
var
semanticDocument
=
await
SemanticDocument
.
CreateAsync
(
doc
,
cancellationToken
).
ConfigureAwait
(
false
);
var
root
=
semanticDocument
.
Root
;
...
...
@@ -75,9 +75,9 @@ private async Task<IEnumerable<SnapshotSpan>> ExpandSelectionAsync(IEnumerable<S
{
var
selectedSpansStart
=
selectedSpans
.
Min
(
span
=>
span
.
Start
);
var
selectedSpansEnd
=
selectedSpans
.
Max
(
span
=>
span
.
End
);
ITextSnapshot
snapshot
=
args
.
TextView
.
TextSnapshot
;
var
snapshot
=
args
.
TextView
.
TextSnapshot
;
IEnumerable
<
SnapshotSpan
>
newSpans
=
await
GetExecutableSyntaxTreeNodeSelectionAsync
(
var
newSpans
=
await
GetExecutableSyntaxTreeNodeSelectionAsync
(
TextSpan
.
FromBounds
(
selectedSpansStart
,
selectedSpansEnd
),
args
,
snapshot
,
...
...
src/EditorFeatures/Core.Wpf/Options/LegacyEditorConfigDocumentOptionsProvider.DocumentOptions.cs
浏览文件 @
955d08a2
...
...
@@ -92,7 +92,7 @@ public StringConvertingDictionary(IReadOnlyDictionary<string, object> underlying
public
bool
TryGetValue
(
string
key
,
out
string
value
)
{
if
(
_underlyingDictionary
.
TryGetValue
(
key
,
out
object
objectValue
))
if
(
_underlyingDictionary
.
TryGetValue
(
key
,
out
var
objectValue
))
{
value
=
objectValue
?.
ToString
();
return
true
;
...
...
src/EditorFeatures/Core.Wpf/Suggestions/SuggestedActions/SuggestedAction.cs
浏览文件 @
955d08a2
...
...
@@ -180,7 +180,7 @@ private void CreateLogProperties(Dictionary<string, object> map)
map
[
FixAllLogger
.
FixAllScope
]
=
fixSome
.
FixAllState
.
Scope
.
ToString
();
}
if
(
TryGetTelemetryId
(
out
Guid
telemetryId
))
if
(
TryGetTelemetryId
(
out
var
telemetryId
))
{
// Lightbulb correlation info
map
[
"TelemetryId"
]
=
telemetryId
.
ToString
();
...
...
src/EditorFeatures/Core.Wpf/SymbolSearch/Patching/Delta.cs
浏览文件 @
955d08a2
...
...
@@ -65,8 +65,8 @@ public static unsafe byte[] ApplyPatch(byte[] sourceBytes, byte[] patchBytes)
fixed
(
byte
*
pSourceBuf
=
sourceBytes
)
fixed
(
byte
*
pPatchBuf
=
patchBytes
)
{
DeltaInput
ds
=
new
DeltaInput
(
pSourceBuf
,
sourceBytes
.
Length
,
true
);
DeltaInput
dp
=
new
DeltaInput
(
pPatchBuf
,
patchBytes
.
Length
,
true
);
var
ds
=
new
DeltaInput
(
pSourceBuf
,
sourceBytes
.
Length
,
true
);
var
dp
=
new
DeltaInput
(
pPatchBuf
,
patchBytes
.
Length
,
true
);
if
(!
ApplyDeltaB
(
DeltaApplyFlag
.
None
,
ds
,
dp
,
...
...
@@ -75,7 +75,7 @@ public static unsafe byte[] ApplyPatch(byte[] sourceBytes, byte[] patchBytes)
throw
new
Win32Exception
();
}
byte
[]
targetBytes
=
new
byte
[
output
.
cbBuf
.
ToInt32
()];
var
targetBytes
=
new
byte
[
output
.
cbBuf
.
ToInt32
()];
Marshal
.
Copy
(
output
.
pBuf
,
targetBytes
,
0
,
targetBytes
.
Length
);
DeltaFree
(
output
.
pBuf
);
return
targetBytes
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录