Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
c7bbf2f0
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,发现更多精彩内容 >>
提交
c7bbf2f0
编写于
10月 05, 2020
作者:
S
Sam Harwell
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Avoid Task allocation on GetInfoForMetadataReferenceAsync fast path
上级
835ac0e3
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
8 addition
and
7 deletion
+8
-7
src/Features/Core/Portable/Completion/Providers/ImportCompletionProvider/ExtensionMethodImportCompletionHelper.ExtensionMethodSymbolComputer.cs
...odImportCompletionHelper.ExtensionMethodSymbolComputer.cs
+3
-3
src/Features/Core/Portable/IncrementalCaches/SymbolTreeInfoCacheService.cs
.../Portable/IncrementalCaches/SymbolTreeInfoCacheService.cs
+1
-1
src/Workspaces/Core/Portable/FindSymbols/SymbolTree/ISymbolTreeInfoCacheService.cs
...ble/FindSymbols/SymbolTree/ISymbolTreeInfoCacheService.cs
+1
-1
src/Workspaces/Core/Portable/FindSymbols/SymbolTree/SymbolTreeInfo_Metadata.cs
...ortable/FindSymbols/SymbolTree/SymbolTreeInfo_Metadata.cs
+3
-2
未找到文件。
src/Features/Core/Portable/Completion/Providers/ImportCompletionProvider/ExtensionMethodImportCompletionHelper.ExtensionMethodSymbolComputer.cs
浏览文件 @
c7bbf2f0
...
...
@@ -84,7 +84,7 @@ public Task PopulateIndicesAsync(CancellationToken cancellationToken)
foreach
(
var
peReference
in
GetAllRelevantPeReferences
())
{
tasks
.
Add
(
Task
.
Run
(()
=>
SymbolTreeInfo
.
GetInfoForMetadataReferenceAsync
(
Solution
,
peReference
,
loadOnly
:
false
,
cancellationToken
),
cancellationToken
));
=>
SymbolTreeInfo
.
GetInfoForMetadataReferenceAsync
(
Solution
,
peReference
,
loadOnly
:
false
,
cancellationToken
)
.
AsTask
()
,
cancellationToken
));
}
return
Task
.
WhenAll
(
tasks
.
ToImmutable
());
...
...
@@ -100,7 +100,7 @@ public async Task<(ImmutableArray<IMethodSymbol> symbols, bool isPartialResult)>
tasks
.
Add
(
Task
.
Run
(()
=>
GetExtensionMethodSymbolsFromPeReferenceAsync
(
peReference
,
forceIndexCreation
,
cancellationToken
),
cancellationToken
));
cancellationToken
)
.
AsTask
()
,
cancellationToken
));
}
foreach
(
var
project
in
GetAllRelevantProjects
())
...
...
@@ -184,7 +184,7 @@ private ImmutableArray<PortableExecutableReference> GetAllRelevantPeReferences()
:
GetExtensionMethodsForSymbolsFromDifferentCompilation
(
matchingMethodSymbols
,
cancellationToken
);
}
private
async
Task
<
ImmutableArray
<
IMethodSymbol
>?>
GetExtensionMethodSymbolsFromPeReferenceAsync
(
private
async
Value
Task
<
ImmutableArray
<
IMethodSymbol
>?>
GetExtensionMethodSymbolsFromPeReferenceAsync
(
PortableExecutableReference
peReference
,
bool
forceIndexCreation
,
CancellationToken
cancellationToken
)
...
...
src/Features/Core/Portable/IncrementalCaches/SymbolTreeInfoCacheService.cs
浏览文件 @
c7bbf2f0
...
...
@@ -29,7 +29,7 @@ private class SymbolTreeInfoCacheService : ISymbolTreeInfoCacheService
_metadataIdToInfo
=
metadataIdToInfo
;
}
public
async
Task
<
SymbolTreeInfo
>
TryGetMetadataSymbolTreeInfoAsync
(
public
async
Value
Task
<
SymbolTreeInfo
>
TryGetMetadataSymbolTreeInfoAsync
(
Solution
solution
,
PortableExecutableReference
reference
,
CancellationToken
cancellationToken
)
...
...
src/Workspaces/Core/Portable/FindSymbols/SymbolTree/ISymbolTreeInfoCacheService.cs
浏览文件 @
c7bbf2f0
...
...
@@ -20,6 +20,6 @@ internal interface ISymbolTreeInfoCacheService : IWorkspaceService
/// <summary>
/// Returns null if the info cannot be retrieved from the cache.
/// </summary>
Task
<
SymbolTreeInfo
>
TryGetMetadataSymbolTreeInfoAsync
(
Solution
solution
,
PortableExecutableReference
reference
,
CancellationToken
cancellationToken
);
Value
Task
<
SymbolTreeInfo
>
TryGetMetadataSymbolTreeInfoAsync
(
Solution
solution
,
PortableExecutableReference
reference
,
CancellationToken
cancellationToken
);
}
}
src/Workspaces/Core/Portable/FindSymbols/SymbolTree/SymbolTreeInfo_Metadata.cs
浏览文件 @
c7bbf2f0
...
...
@@ -65,7 +65,7 @@ private static Metadata GetMetadataNoThrow(PortableExecutableReference reference
}
}
public
static
Task
<
SymbolTreeInfo
>
GetInfoForMetadataReferenceAsync
(
public
static
Value
Task
<
SymbolTreeInfo
>
GetInfoForMetadataReferenceAsync
(
Solution
solution
,
PortableExecutableReference
reference
,
bool
loadOnly
,
CancellationToken
cancellationToken
)
{
...
...
@@ -79,7 +79,8 @@ private static Metadata GetMetadataNoThrow(PortableExecutableReference reference
/// Produces a <see cref="SymbolTreeInfo"/> for a given <see cref="PortableExecutableReference"/>.
/// Note: will never return null;
/// </summary>
public
static
async
Task
<
SymbolTreeInfo
>
GetInfoForMetadataReferenceAsync
(
[
PerformanceSensitive
(
"https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1224834"
,
OftenCompletesSynchronously
=
true
)]
public
static
async
ValueTask
<
SymbolTreeInfo
>
GetInfoForMetadataReferenceAsync
(
Solution
solution
,
PortableExecutableReference
reference
,
Checksum
checksum
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录