Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
8b7ad834
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,发现更多精彩内容 >>
提交
8b7ad834
编写于
5月 10, 2017
作者:
C
CyrusNajmabadi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Don't require spell checker.
上级
b4c9c9e6
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
9 addition
and
17 deletion
+9
-17
src/Workspaces/Core/Portable/FindSymbols/SymbolTree/SymbolTreeInfo.cs
...es/Core/Portable/FindSymbols/SymbolTree/SymbolTreeInfo.cs
+2
-2
src/Workspaces/Core/Portable/FindSymbols/SymbolTree/SymbolTreeInfo_Metadata.cs
...ortable/FindSymbols/SymbolTree/SymbolTreeInfo_Metadata.cs
+1
-3
src/Workspaces/Core/Portable/FindSymbols/SymbolTree/SymbolTreeInfo_Serialization.cs
...le/FindSymbols/SymbolTree/SymbolTreeInfo_Serialization.cs
+4
-8
src/Workspaces/Core/Portable/FindSymbols/SymbolTree/SymbolTreeInfo_Source.cs
.../Portable/FindSymbols/SymbolTree/SymbolTreeInfo_Source.cs
+1
-3
src/Workspaces/Core/Portable/Utilities/SpellChecker.cs
src/Workspaces/Core/Portable/Utilities/SpellChecker.cs
+1
-1
未找到文件。
src/Workspaces/Core/Portable/FindSymbols/SymbolTree/SymbolTreeInfo.cs
浏览文件 @
8b7ad834
...
...
@@ -16,9 +16,9 @@
namespace
Microsoft.CodeAnalysis.FindSymbols
{
internal
partial
class
SymbolTreeInfo
internal
partial
class
SymbolTreeInfo
:
IChecksummedObject
{
public
readonly
Checksum
Checksum
;
public
Checksum
Checksum
{
get
;
}
/// <summary>
/// To prevent lots of allocations, we concatenate all the names in all our
...
...
src/Workspaces/Core/Portable/FindSymbols/SymbolTree/SymbolTreeInfo_Metadata.cs
浏览文件 @
8b7ad834
...
...
@@ -158,11 +158,9 @@ private static Metadata GetMetadataNoThrow(PortableExecutableReference reference
var
result
=
TryLoadOrCreateAsync
(
solution
,
checksum
,
filePath
,
loadOnly
,
createAsync
:
()
=>
CreateMetadataSymbolTreeInfoAsync
(
solution
,
checksum
,
reference
,
cancellationToken
),
keySuffix
:
"_Metadata"
,
getPersistedChecksum
:
info
=>
info
.
Checksum
,
keySuffix
:
"_Metadata_"
+
filePath
,
readObject
:
reader
=>
ReadSymbolTreeInfo
(
reader
,
(
names
,
nodes
)
=>
GetSpellCheckerTask
(
solution
,
checksum
,
filePath
,
names
,
nodes
)),
cancellationToken
:
cancellationToken
);
Contract
.
ThrowIfFalse
(
result
!=
null
||
loadOnly
==
true
,
"Result can only be null if 'loadOnly: true' was passed."
);
...
...
src/Workspaces/Core/Portable/FindSymbols/SymbolTree/SymbolTreeInfo_Serialization.cs
浏览文件 @
8b7ad834
...
...
@@ -32,11 +32,9 @@ internal partial class SymbolTreeInfo : IObjectWritable
var
result
=
TryLoadOrCreateAsync
(
solution
,
checksum
,
filePath
,
loadOnly
:
false
,
createAsync
:
createAsync
,
keySuffix
:
"_SpellChecker"
,
getPersistedChecksum
:
s
=>
s
.
Checksum
,
keySuffix
:
"_SpellChecker_"
+
filePath
,
readObject
:
SpellChecker
.
ReadFrom
,
cancellationToken
:
CancellationToken
.
None
);
Contract
.
ThrowIfNull
(
result
,
"Result should never be null as we passed 'loadOnly: false'."
);
...
...
@@ -50,13 +48,11 @@ internal partial class SymbolTreeInfo : IObjectWritable
private
static
async
Task
<
T
>
TryLoadOrCreateAsync
<
T
>(
Solution
solution
,
Checksum
checksum
,
string
filePath
,
bool
loadOnly
,
Func
<
Task
<
T
>>
createAsync
,
string
keySuffix
,
Func
<
T
,
Checksum
>
getPersistedChecksum
,
Func
<
ObjectReader
,
T
>
readObject
,
CancellationToken
cancellationToken
)
where
T
:
class
,
IObjectWritable
CancellationToken
cancellationToken
)
where
T
:
class
,
IObjectWritable
,
IChecksummedObject
{
if
(
checksum
==
null
)
{
...
...
@@ -70,7 +66,7 @@ internal partial class SymbolTreeInfo : IObjectWritable
using
(
var
storage
=
persistentStorageService
.
GetStorage
(
solution
,
checkBranchId
:
false
))
{
// Get the unique key to identify our data.
var
key
=
PrefixMetadataSymbolTreeInfo
+
keySuffix
+
"_"
+
filePath
;
var
key
=
PrefixMetadataSymbolTreeInfo
+
keySuffix
;
using
(
var
stream
=
await
storage
.
ReadStreamAsync
(
key
,
cancellationToken
).
ConfigureAwait
(
false
))
using
(
var
reader
=
ObjectReader
.
TryGetReader
(
stream
))
{
...
...
@@ -80,7 +76,7 @@ internal partial class SymbolTreeInfo : IObjectWritable
// If we're able to, and the version of the persisted data matches
// our version, then we can reuse this instance.
result
=
readObject
(
reader
);
if
(
result
!=
null
&&
checksum
==
getPersistedChecksum
(
result
)
)
if
(
result
!=
null
&&
checksum
==
result
.
Checksum
)
{
return
result
;
}
...
...
src/Workspaces/Core/Portable/FindSymbols/SymbolTree/SymbolTreeInfo_Source.cs
浏览文件 @
8b7ad834
...
...
@@ -32,11 +32,9 @@ private static void FreeSymbolMap(MultiDictionary<string, ISymbol> symbolMap)
var
result
=
TryLoadOrCreateAsync
(
project
.
Solution
,
checksum
,
project
.
FilePath
,
loadOnly
:
false
,
createAsync
:
()
=>
CreateSourceSymbolTreeInfoAsync
(
project
,
checksum
,
cancellationToken
),
keySuffix
:
"_Source"
,
getPersistedChecksum
:
info
=>
info
.
Checksum
,
keySuffix
:
"_Source_"
+
project
.
FilePath
,
readObject
:
reader
=>
ReadSymbolTreeInfo
(
reader
,
(
names
,
nodes
)
=>
GetSpellCheckerTask
(
project
.
Solution
,
checksum
,
project
.
FilePath
,
names
,
nodes
)),
cancellationToken
:
cancellationToken
);
Contract
.
ThrowIfNull
(
result
,
"Result should never be null as we passed 'loadOnly: false'."
);
...
...
src/Workspaces/Core/Portable/Utilities/SpellChecker.cs
浏览文件 @
8b7ad834
...
...
@@ -10,7 +10,7 @@
namespace
Roslyn.Utilities
{
internal
class
SpellChecker
:
IObjectWritable
internal
class
SpellChecker
:
IObjectWritable
,
IChecksummedObject
{
private
const
string
SerializationFormat
=
"3"
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录