Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
c5ac4849
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,发现更多精彩内容 >>
提交
c5ac4849
编写于
10月 31, 2019
作者:
T
Tomas Matousek
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Do not report EnC diagnostics when EnC is disabled
上级
b8a5611e
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
52 addition
and
45 deletion
+52
-45
eng/Versions.props
eng/Versions.props
+1
-1
src/EditorFeatures/Core/Implementation/Diagnostics/DiagnosticsSquiggleTaggerProvider.cs
...entation/Diagnostics/DiagnosticsSquiggleTaggerProvider.cs
+4
-7
src/VisualStudio/Core/Def/Implementation/EditAndContinue/VisualStudioDebugStateChangeListener.cs
...n/EditAndContinue/VisualStudioDebugStateChangeListener.cs
+47
-37
未找到文件。
eng/Versions.props
浏览文件 @
c5ac4849
...
...
@@ -98,7 +98,7 @@
<MicrosoftVisualStudioComponentModelHostVersion>
16.0.198-g52de9c2988
</MicrosoftVisualStudioComponentModelHostVersion>
<MicrosoftVisualStudioCompositionVersion>
15.5.23
</MicrosoftVisualStudioCompositionVersion>
<MicrosoftVisualStudioCoreUtilityVersion>
$(VisualStudioEditorPackagesVersion)
</MicrosoftVisualStudioCoreUtilityVersion>
<MicrosoftVisualStudioDebuggerUIInterfacesVersion>
16.0.29
213.96
</MicrosoftVisualStudioDebuggerUIInterfacesVersion>
<MicrosoftVisualStudioDebuggerUIInterfacesVersion>
16.0.29
431.108
</MicrosoftVisualStudioDebuggerUIInterfacesVersion>
<MicrosoftVisualStudioDebuggerEngineimplementationVersion>
16.4.1091102-preview
</MicrosoftVisualStudioDebuggerEngineimplementationVersion>
<MicrosoftVisualStudioDebuggerMetadataimplementationVersion>
16.4.1091102-preview
</MicrosoftVisualStudioDebuggerMetadataimplementationVersion>
<MicrosoftVisualStudioDesignerInterfacesVersion>
1.1.4322
</MicrosoftVisualStudioDesignerInterfacesVersion>
...
...
src/EditorFeatures/Core/Implementation/Diagnostics/DiagnosticsSquiggleTaggerProvider.cs
浏览文件 @
c5ac4849
...
...
@@ -79,16 +79,13 @@ private string GetErrorTypeFromDiagnostic(DiagnosticData diagnostic)
private
string
GetErrorTypeFromDiagnosticTags
(
DiagnosticData
diagnostic
)
{
if
(
diagnostic
.
CustomTags
.
Count
<=
1
)
if
(
diagnostic
.
Severity
==
DiagnosticSeverity
.
Error
&&
diagnostic
.
CustomTags
.
Contains
(
WellKnownDiagnosticTags
.
EditAndContinue
))
{
return
null
;
return
EditAndContinueErrorTypeDefinition
.
Name
;
}
return
diagnostic
.
CustomTags
[
0
]
switch
{
WellKnownDiagnosticTags
.
EditAndContinue
=>
EditAndContinueErrorTypeDefinition
.
Name
,
_
=>
null
,
};
return
null
;
}
private
static
string
GetErrorTypeFromDiagnosticSeverity
(
DiagnosticData
diagnostic
)
...
...
src/VisualStudio/Core/Def/Implementation/EditAndContinue/VisualStudioDebugStateChangeListener.cs
浏览文件 @
c5ac4849
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
#
nullable
enable
using
System
;
using
System.ComponentModel.Composition
;
using
Microsoft.CodeAnalysis
;
using
Microsoft.CodeAnalysis.Debugging
;
using
Microsoft.CodeAnalysis.EditAndContinue
;
using
Microsoft.VisualStudio.Debugger
;
using
Microsoft.VisualStudio.Debugger.Clr
;
using
Microsoft.VisualStudio.Debugger.ComponentInterfaces
;
using
Microsoft.VisualStudio.Debugger.UI.Interfaces
;
using
Roslyn.Utilities
;
namespace
Microsoft.VisualStudio.LanguageServices.EditAndContinue
{
[
Export
(
typeof
(
IDebugStateChangeListener
))]
internal
sealed
class
VisualStudioDebugStateChangeListener
:
IDebugStateChangeListener
{
private
readonly
Workspace
_workspace
;
private
readonly
IDebuggingWorkspaceService
_debuggingService
;
private
readonly
IEditAndContinueWorkspaceService
_encService
;
private
readonly
VisualStudioDebuggeeModuleMetadataProvider
_moduleMetadataProvider
;
// EnC service or null if EnC is disabled for the debug session.
private
IEditAndContinueWorkspaceService
?
_encService
;
/// <summary>
/// Concord component. Singleton created on demand during debugging session and discarded as soon as the session ends.
/// </summary>
private
sealed
class
DebuggerService
:
IDkmCustomMessageForwardReceiver
,
IDkmModuleInstanceLoadNotification
,
IDkmModuleInstanceUnloadNotification
{
private
VisualStudioDebugStateChangeListener
_listener
;
private
IEditAndContinueWorkspaceService
?
_encService
;
/// <summary>
/// Message source id as specified in ManagedEditAndContinueService.vsdconfigxml.
/// </summary>
public
static
readonly
Guid
MessageSourceId
=
new
Guid
(
"730432E7-1B68-4B3A-BD6A-BD4C13E0566B"
);
DkmCustomMessage
IDkmCustomMessageForwardReceiver
.
SendLower
(
DkmCustomMessage
customMessage
)
DkmCustomMessage
?
IDkmCustomMessageForwardReceiver
.
SendLower
(
DkmCustomMessage
customMessage
)
{
_
listener
=
(
VisualStudioDebugStateChangeListener
)
customMessage
.
Parameter1
;
_
encService
=
(
IEditAndContinueWorkspaceService
)
customMessage
.
Parameter1
;
return
null
;
}
...
...
@@ -48,7 +54,8 @@ void IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad(DkmModuleInstance m
{
if
(
moduleInstance
is
DkmClrModuleInstance
clrModuleInstance
)
{
_listener
.
OnManagedModuleInstanceLoaded
(
clrModuleInstance
);
Contract
.
ThrowIfNull
(
_encService
);
_encService
.
OnManagedModuleInstanceLoaded
(
clrModuleInstance
.
Mvid
);
}
}
...
...
@@ -58,67 +65,70 @@ void IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad(DkmModuleInstance m
/// will be suspended and can be examined. ModuleInstanceUnload is sent when the monitor
/// detects that a module has unloaded from within the target process.
/// </summary>
public
void
OnModuleInstanceUnload
(
DkmModuleInstance
moduleInstance
,
DkmWorkList
workList
,
DkmEventDescriptor
eventDescriptor
)
void
IDkmModuleInstanceUnloadNotification
.
OnModuleInstanceUnload
(
DkmModuleInstance
moduleInstance
,
DkmWorkList
workList
,
DkmEventDescriptor
eventDescriptor
)
{
if
(
moduleInstance
is
DkmClrModuleInstance
clrModuleInstance
)
{
_listener
.
OnManagedModuleInstanceUnloaded
(
clrModuleInstance
);
Contract
.
ThrowIfNull
(
_encService
);
_encService
.
OnManagedModuleInstanceUnloaded
(
clrModuleInstance
.
Mvid
);
}
}
}
[
ImportingConstructor
]
public
VisualStudioDebugStateChangeListener
(
VisualStudioWorkspace
workspace
,
VisualStudioDebuggeeModuleMetadataProvider
moduleMetadataProvider
)
public
VisualStudioDebugStateChangeListener
(
VisualStudioWorkspace
workspace
)
{
_
moduleMetadataProvider
=
moduleMetadataProvider
;
_
workspace
=
workspace
;
_debuggingService
=
workspace
.
Services
.
GetRequiredService
<
IDebuggingWorkspaceService
>();
_encService
=
workspace
.
Services
.
GetRequiredService
<
IEditAndContinueWorkspaceService
>();
}
public
void
StartDebugging
()
/// <summary>
/// Called by the debugger when a debugging session starts and managed debugging is being used.
/// </summary>
public
void
StartDebugging
(
DebugSessionOptions
options
)
{
// hook up a callbacks (the call blocks until the message is processed):
using
(
DebuggerComponent
.
ManagedEditAndContinueService
())
_debuggingService
.
OnBeforeDebuggingStateChanged
(
DebuggingState
.
Design
,
DebuggingState
.
Run
);
if
((
options
&
DebugSessionOptions
.
EditAndContinueDisabled
)
==
0
)
{
DkmCustomMessage
.
Create
(
Connection
:
null
,
Process
:
null
,
SourceId
:
DebuggerService
.
MessageSourceId
,
MessageCode
:
0
,
Parameter1
:
this
,
Parameter2
:
null
).
SendLower
();
}
_encService
=
_workspace
.
Services
.
GetRequiredService
<
IEditAndContinueWorkspaceService
>();
_debuggingService
.
OnBeforeDebuggingStateChanged
(
DebuggingState
.
Design
,
DebuggingState
.
Run
);
// hook up a callbacks (the call blocks until the message is processed):
using
(
DebuggerComponent
.
ManagedEditAndContinueService
())
{
DkmCustomMessage
.
Create
(
Connection
:
null
,
Process
:
null
,
SourceId
:
DebuggerService
.
MessageSourceId
,
MessageCode
:
0
,
Parameter1
:
_encService
,
Parameter2
:
null
).
SendLower
();
}
_encService
.
StartDebuggingSession
();
_encService
.
StartDebuggingSession
();
}
else
{
_encService
=
null
;
}
}
public
void
EnterBreakState
(
BreakStateKind
kind
)
public
void
EnterBreakState
()
{
// When stopped at exception - start an edit session as usual and report a rude edit for all changes we see.
bool
stoppedAtException
=
kind
==
BreakStateKind
.
StoppedAtException
;
_debuggingService
.
OnBeforeDebuggingStateChanged
(
DebuggingState
.
Run
,
DebuggingState
.
Break
);
_encService
.
StartEditSession
();
_encService
?
.
StartEditSession
();
}
public
void
ExitBreakState
()
{
_debuggingService
.
OnBeforeDebuggingStateChanged
(
DebuggingState
.
Break
,
DebuggingState
.
Run
);
_encService
.
EndEditSession
();
_encService
?
.
EndEditSession
();
}
public
void
StopDebugging
()
{
_debuggingService
.
OnBeforeDebuggingStateChanged
(
DebuggingState
.
Run
,
DebuggingState
.
Design
);
_encService
.
EndDebuggingSession
();
_encService
?
.
EndDebuggingSession
();
}
internal
void
OnManagedModuleInstanceLoaded
(
DkmClrModuleInstance
moduleInstance
)
=>
_encService
.
OnManagedModuleInstanceLoaded
(
moduleInstance
.
Mvid
);
internal
void
OnManagedModuleInstanceUnloaded
(
DkmClrModuleInstance
moduleInstance
)
=>
_encService
.
OnManagedModuleInstanceUnloaded
(
moduleInstance
.
Mvid
);
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录