Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
e8607c1d
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,发现更多精彩内容 >>
提交
e8607c1d
编写于
6月 28, 2019
作者:
C
Cyrus Najmabadi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use deconstruction'
上级
a1cb7981
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
16 addition
and
24 deletion
+16
-24
src/EditorFeatures/Core.Wpf/Interactive/InteractiveDocumentNavigationService.cs
...e.Wpf/Interactive/InteractiveDocumentNavigationService.cs
+1
-2
src/Features/Core/Portable/Completion/Providers/AbstractRecommendationServiceBasedCompletionProvider.cs
...s/AbstractRecommendationServiceBasedCompletionProvider.cs
+3
-3
src/Features/Core/Portable/Completion/Providers/AbstractSymbolCompletionProvider.cs
.../Completion/Providers/AbstractSymbolCompletionProvider.cs
+3
-3
src/Features/Core/Portable/GenerateMember/GenerateConstructor/AbstractGenerateConstructorService.CodeAction.cs
...structor/AbstractGenerateConstructorService.CodeAction.cs
+2
-2
src/Features/Core/Portable/ImplementInterface/AbstractImplementInterfaceService.CodeAction.cs
...Interface/AbstractImplementInterfaceService.CodeAction.cs
+1
-4
src/Features/Core/Portable/ReplacePropertyWithMethods/ReplacePropertyWithMethodsCodeRefactoringProvider.cs
...hods/ReplacePropertyWithMethodsCodeRefactoringProvider.cs
+5
-8
src/VisualStudio/Core/Def/Implementation/Venus/ContainedDocument.cs
...Studio/Core/Def/Implementation/Venus/ContainedDocument.cs
+1
-2
未找到文件。
src/EditorFeatures/Core.Wpf/Interactive/InteractiveDocumentNavigationService.cs
浏览文件 @
e8607c1d
...
...
@@ -51,8 +51,7 @@ public bool TryNavigateToSpan(Workspace workspace, DocumentId documentId, TextSp
var
snapshotSpan
=
new
SnapshotSpan
(
textSnapshot
,
textSpan
.
Start
,
textSpan
.
Length
);
var
virtualSnapshotSpan
=
new
VirtualSnapshotSpan
(
snapshotSpan
);
VirtualSnapshotSpan
surfaceBufferSpan
;
if
(!
textView
.
TryGetSurfaceBufferSpan
(
virtualSnapshotSpan
,
out
surfaceBufferSpan
))
if
(!
textView
.
TryGetSurfaceBufferSpan
(
virtualSnapshotSpan
,
out
var
surfaceBufferSpan
))
{
return
false
;
}
...
...
src/Features/Core/Portable/Completion/Providers/AbstractRecommendationServiceBasedCompletionProvider.cs
浏览文件 @
e8607c1d
...
...
@@ -121,12 +121,12 @@ private static int ComputeSymbolMatchPriority(ISymbol symbol)
var
relatedDocumentIds
=
document
.
Project
.
Solution
.
GetRelatedDocumentIds
(
document
.
Id
).
Concat
(
document
.
Id
);
var
options
=
document
.
Project
.
Solution
.
Workspace
.
Options
;
var
totalSymbols
=
await
base
.
GetPerContextSymbols
(
document
,
position
,
options
,
relatedDocumentIds
,
preselect
:
false
,
cancellationToken
:
cancellationToken
).
ConfigureAwait
(
false
);
foreach
(
var
info
in
totalSymbols
)
foreach
(
var
(
documentId
,
syntaxContext
,
symbols
)
in
totalSymbols
)
{
var
bestSymbols
=
info
.
symbols
.
Where
(
s
=>
kind
!=
null
&&
s
.
Kind
==
kind
&&
s
.
Name
==
name
).
ToImmutableArray
();
var
bestSymbols
=
symbols
.
Where
(
s
=>
kind
!=
null
&&
s
.
Kind
==
kind
&&
s
.
Name
==
name
).
ToImmutableArray
();
if
(
bestSymbols
.
Any
())
{
return
await
SymbolCompletionItem
.
GetDescriptionAsync
(
item
,
bestSymbols
,
document
,
info
.
syntaxContext
.
SemanticModel
,
cancellationToken
).
ConfigureAwait
(
false
);
return
await
SymbolCompletionItem
.
GetDescriptionAsync
(
item
,
bestSymbols
,
document
,
syntaxContext
.
SemanticModel
,
cancellationToken
).
ConfigureAwait
(
false
);
}
}
...
...
src/Features/Core/Portable/Completion/Providers/AbstractSymbolCompletionProvider.cs
浏览文件 @
e8607c1d
...
...
@@ -407,12 +407,12 @@ private Task<SyntaxContext> GetOrCreateContext(Document document, int position,
{
var
missingSymbols
=
new
Dictionary
<
ISymbol
,
List
<
ProjectId
>>(
LinkedFilesSymbolEquivalenceComparer
.
Instance
);
foreach
(
var
linkedContextSymbolList
in
linkedContextSymbolLists
)
foreach
(
var
(
documentId
,
syntaxContext
,
symbols
)
in
linkedContextSymbolLists
)
{
var
symbolsMissingInLinkedContext
=
symbolToContext
.
Keys
.
Except
(
linkedContextSymbolList
.
symbols
,
LinkedFilesSymbolEquivalenceComparer
.
Instance
);
var
symbolsMissingInLinkedContext
=
symbolToContext
.
Keys
.
Except
(
symbols
,
LinkedFilesSymbolEquivalenceComparer
.
Instance
);
foreach
(
var
missingSymbol
in
symbolsMissingInLinkedContext
)
{
missingSymbols
.
GetOrAdd
(
missingSymbol
,
m
=>
new
List
<
ProjectId
>()).
Add
(
linkedContextSymbolList
.
documentId
.
ProjectId
);
missingSymbols
.
GetOrAdd
(
missingSymbol
,
m
=>
new
List
<
ProjectId
>()).
Add
(
documentId
.
ProjectId
);
}
}
...
...
src/Features/Core/Portable/GenerateMember/GenerateConstructor/AbstractGenerateConstructorService.CodeAction.cs
浏览文件 @
e8607c1d
...
...
@@ -29,8 +29,8 @@ private class GenerateConstructorCodeAction : CodeAction
protected
override
async
Task
<
Document
>
GetChangedDocumentAsync
(
CancellationToken
cancellationToken
)
{
var
result
=
await
GetEditAsync
(
cancellationToken
).
ConfigureAwait
(
false
);
return
result
.
document
;
var
(
document
,
_
)
=
await
GetEditAsync
(
cancellationToken
).
ConfigureAwait
(
false
);
return
document
;
}
public
async
Task
<(
Document
document
,
bool
addedFields
)>
GetEditAsync
(
CancellationToken
cancellationToken
)
...
...
src/Features/Core/Portable/ImplementInterface/AbstractImplementInterfaceService.CodeAction.cs
浏览文件 @
e8607c1d
...
...
@@ -224,11 +224,8 @@ public Task<Document> GetUpdatedDocumentAsync(CancellationToken cancellationToke
var
implementedVisibleMembers
=
new
List
<
ISymbol
>();
var
implementedMembers
=
ArrayBuilder
<
ISymbol
>.
GetInstance
();
foreach
(
var
tuple
in
unimplementedMembers
)
foreach
(
var
(
_
,
unimplementedInterfaceMembers
)
in
unimplementedMembers
)
{
var
interfaceType
=
tuple
.
type
;
var
unimplementedInterfaceMembers
=
tuple
.
members
;
foreach
(
var
unimplementedInterfaceMember
in
unimplementedInterfaceMembers
)
{
var
member
=
GenerateMember
(
...
...
src/Features/Core/Portable/ReplacePropertyWithMethods/ReplacePropertyWithMethodsCodeRefactoringProvider.cs
浏览文件 @
e8607c1d
...
...
@@ -363,30 +363,27 @@ private string GetDefinitionIssues(IEnumerable<ReferencedSymbol> getMethodRefere
var
editor
=
new
SyntaxEditor
(
root
,
updatedSolution
.
Workspace
);
// First replace all the properties with the appropriate getters/setters.
foreach
(
var
definition
in
currentDefinitions
)
foreach
(
var
(
property
,
declaration
)
in
currentDefinitions
)
{
cancellationToken
.
ThrowIfCancellationRequested
();
var
propertyDefinition
=
definition
.
property
;
var
propertyDeclaration
=
definition
.
declaration
;
var
members
=
await
service
.
GetReplacementMembersAsync
(
updatedDocument
,
property
Definition
,
propertyD
eclaration
,
definitionToBackingField
.
GetValueOrDefault
(
property
Definition
),
property
,
d
eclaration
,
definitionToBackingField
.
GetValueOrDefault
(
property
),
desiredGetMethodName
,
desiredSetMethodName
,
cancellationToken
).
ConfigureAwait
(
false
);
// Properly make the members fit within an interface if that's what
// we're generating into.
if
(
property
Definition
.
ContainingType
.
TypeKind
==
TypeKind
.
Interface
)
if
(
property
.
ContainingType
.
TypeKind
==
TypeKind
.
Interface
)
{
members
=
members
.
Select
(
editor
.
Generator
.
AsInterfaceMember
)
.
WhereNotNull
()
.
ToList
();
}
var
nodeToReplace
=
service
.
GetPropertyNodeToReplace
(
propertyD
eclaration
);
var
nodeToReplace
=
service
.
GetPropertyNodeToReplace
(
d
eclaration
);
editor
.
InsertAfter
(
nodeToReplace
,
members
);
editor
.
RemoveNode
(
nodeToReplace
);
}
...
...
src/VisualStudio/Core/Def/Implementation/Venus/ContainedDocument.cs
浏览文件 @
e8607c1d
...
...
@@ -68,8 +68,7 @@ public static ContainedDocument TryGetContainedDocument(DocumentId id)
return
null
;
}
ContainedDocument
document
;
s_containedDocuments
.
TryGetValue
(
id
,
out
document
);
s_containedDocuments
.
TryGetValue
(
id
,
out
var
document
);
return
document
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录