Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
18c2673a
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,体验更适合开发者的 AI 搜索 >>
提交
18c2673a
编写于
11月 29, 2017
作者:
S
Sam Harwell
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add an option to enable navigation to decompiled sources
上级
c6d5680b
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
37 addition
and
3 deletion
+37
-3
src/EditorFeatures/Core/Implementation/MetadataAsSource/MetadataAsSourceFileService.cs
...mentation/MetadataAsSource/MetadataAsSourceFileService.cs
+13
-3
src/EditorFeatures/Core/Shared/Options/FeatureOnOffOptions.cs
...EditorFeatures/Core/Shared/Options/FeatureOnOffOptions.cs
+6
-0
src/VisualStudio/CSharp/Impl/Options/AdvancedOptionPageControl.xaml
...Studio/CSharp/Impl/Options/AdvancedOptionPageControl.xaml
+2
-0
src/VisualStudio/CSharp/Impl/Options/AdvancedOptionPageControl.xaml.cs
...dio/CSharp/Impl/Options/AdvancedOptionPageControl.xaml.cs
+1
-0
src/VisualStudio/CSharp/Impl/Options/AdvancedOptionPageStrings.cs
...alStudio/CSharp/Impl/Options/AdvancedOptionPageStrings.cs
+3
-0
src/VisualStudio/Core/Def/ServicesVSResources.Designer.cs
src/VisualStudio/Core/Def/ServicesVSResources.Designer.cs
+9
-0
src/VisualStudio/Core/Def/ServicesVSResources.resx
src/VisualStudio/Core/Def/ServicesVSResources.resx
+3
-0
未找到文件。
src/EditorFeatures/Core/Implementation/MetadataAsSource/MetadataAsSourceFileService.cs
浏览文件 @
18c2673a
...
...
@@ -10,6 +10,7 @@
using
ICSharpCode.Decompiler
;
using
ICSharpCode.Decompiler.CSharp
;
using
ICSharpCode.Decompiler.TypeSystem
;
using
Microsoft.CodeAnalysis.Editor.Shared.Options
;
using
Microsoft.CodeAnalysis.ErrorReporting
;
using
Microsoft.CodeAnalysis.MetadataAsSource
;
using
Microsoft.CodeAnalysis.Shared.Extensions
;
...
...
@@ -112,11 +113,20 @@ public async Task<MetadataAsSourceFile> GetGeneratedFileAsync(Project project, I
var
temporaryDocument
=
_workspace
.
CurrentSolution
.
AddProject
(
temporaryProjectInfoAndDocumentId
.
Item1
)
.
GetDocument
(
temporaryProjectInfoAndDocumentId
.
Item2
);
try
var
useDecompiler
=
project
.
Solution
.
Workspace
.
Options
.
GetOption
(
FeatureOnOffOptions
.
NavigateToDecompiledSources
);
if
(
useDecompiler
)
{
temporaryDocument
=
await
DecompileSymbolAsync
(
temporaryDocument
,
symbol
,
cancellationToken
).
ConfigureAwait
(
false
);
try
{
temporaryDocument
=
await
DecompileSymbolAsync
(
temporaryDocument
,
symbol
,
cancellationToken
).
ConfigureAwait
(
false
);
}
catch
(
Exception
e
)
when
(
FatalError
.
ReportWithoutCrashUnlessCanceled
(
e
))
{
useDecompiler
=
false
;
}
}
catch
(
Exception
e
)
when
(
FatalError
.
ReportWithoutCrashUnlessCanceled
(
e
))
if
(!
useDecompiler
)
{
var
sourceFromMetadataService
=
temporaryDocument
.
Project
.
LanguageServices
.
GetService
<
IMetadataAsSourceService
>();
temporaryDocument
=
await
sourceFromMetadataService
.
AddSourceToAsync
(
temporaryDocument
,
symbol
,
cancellationToken
).
ConfigureAwait
(
false
);
...
...
src/EditorFeatures/Core/Shared/Options/FeatureOnOffOptions.cs
浏览文件 @
18c2673a
...
...
@@ -78,6 +78,12 @@ internal static class FeatureOnOffOptions
public
static
readonly
PerLanguageOption
<
bool
>
StreamingGoToImplementation
=
new
PerLanguageOption
<
bool
>(
nameof
(
FeatureOnOffOptions
),
nameof
(
StreamingGoToImplementation
),
defaultValue
:
true
);
private
const
string
LocalRegistryPath
=
@"Roslyn\Features\"
;
public
static
readonly
Option
<
bool
>
NavigateToDecompiledSources
=
new
Option
<
bool
>(
nameof
(
FeatureOnOffOptions
),
nameof
(
NavigateToDecompiledSources
),
defaultValue
:
false
,
storageLocations
:
new
LocalUserProfileStorageLocation
(
LocalRegistryPath
+
nameof
(
NavigateToDecompiledSources
)));
}
[
ExportOptionProvider
,
Shared
]
...
...
src/VisualStudio/CSharp/Impl/Options/AdvancedOptionPageControl.xaml
浏览文件 @
18c2673a
...
...
@@ -19,6 +19,8 @@
Content="{x:Static local:AdvancedOptionPageStrings.Option_Enable_full_solution_analysis}" />
<CheckBox x:Name="Perform_editor_feature_analysis_in_external_process"
Content="{x:Static local:AdvancedOptionPageStrings.Option_Perform_editor_feature_analysis_in_external_process}" />
<CheckBox x:Name="Enable_navigation_to_decompiled_sources"
Content="{x:Static local:AdvancedOptionPageStrings.Option_Enable_navigation_to_decompiled_sources}" />
</StackPanel>
</GroupBox>
<GroupBox x:Uid="UsingDirectivesGroupBox"
...
...
src/VisualStudio/CSharp/Impl/Options/AdvancedOptionPageControl.xaml.cs
浏览文件 @
18c2673a
...
...
@@ -24,6 +24,7 @@ public AdvancedOptionPageControl(IServiceProvider serviceProvider) : base(servic
BindToFullSolutionAnalysisOption
(
Enable_full_solution_analysis
,
LanguageNames
.
CSharp
);
BindToOption
(
Perform_editor_feature_analysis_in_external_process
,
RemoteFeatureOptions
.
OutOfProcessAllowed
);
BindToOption
(
Enable_navigation_to_decompiled_sources
,
FeatureOnOffOptions
.
NavigateToDecompiledSources
);
BindToOption
(
PlaceSystemNamespaceFirst
,
GenerationOptions
.
PlaceSystemNamespaceFirst
,
LanguageNames
.
CSharp
);
BindToOption
(
SeparateImportGroups
,
GenerationOptions
.
SeparateImportDirectiveGroups
,
LanguageNames
.
CSharp
);
...
...
src/VisualStudio/CSharp/Impl/Options/AdvancedOptionPageStrings.cs
浏览文件 @
18c2673a
...
...
@@ -18,6 +18,9 @@ public static string Option_Enable_full_solution_analysis
public
static
string
Option_Perform_editor_feature_analysis_in_external_process
=>
ServicesVSResources
.
Perform_editor_feature_analysis_in_external_process
;
public
static
string
Option_Enable_navigation_to_decompiled_sources
=>
ServicesVSResources
.
Enable_navigation_to_decompiled_sources
;
public
static
string
Option_RenameTrackingPreview
=>
CSharpVSResources
.
Show_preview_for_rename_tracking
;
public
static
string
Option_Split_string_literals_on_enter
=>
CSharpVSResources
.
Split_string_literals_on_enter
;
...
...
src/VisualStudio/Core/Def/ServicesVSResources.Designer.cs
浏览文件 @
18c2673a
...
...
@@ -696,6 +696,15 @@ internal class ServicesVSResources {
}
}
/// <summary>
/// Looks up a localized string similar to Enable navigation to decompiled sources (experimental).
/// </summary>
internal
static
string
Enable_navigation_to_decompiled_sources
{
get
{
return
ResourceManager
.
GetString
(
"Enable_navigation_to_decompiled_sources"
,
resourceCulture
);
}
}
/// <summary>
/// Looks up a localized string similar to --- End of inner exception stack trace ---.
/// </summary>
...
...
src/VisualStudio/Core/Def/ServicesVSResources.resx
浏览文件 @
18c2673a
...
...
@@ -977,4 +977,7 @@ Additional information: {1}</value>
<data
name=
"Search_found_no_results"
xml:space=
"preserve"
>
<value>
Search found no results
</value>
</data>
<data
name=
"Enable_navigation_to_decompiled_sources"
xml:space=
"preserve"
>
<value>
Enable navigation to decompiled sources (experimental)
</value>
</data>
</root>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录