Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
6801607c
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,发现更多精彩内容 >>
未验证
提交
6801607c
编写于
10月 24, 2018
作者:
I
Ivan Basov
提交者:
GitHub
10月 24, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
set content type for AbstractDebuggerIntelliSenseContext to the original content type (#30679)
上级
9046f1ed
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
15 addition
and
6 deletion
+15
-6
src/VisualStudio/Core/Def/Implementation/DebuggerIntelliSense/AbstractDebuggerIntelliSenseContext.cs
...buggerIntelliSense/AbstractDebuggerIntelliSenseContext.cs
+8
-0
src/VisualStudio/Core/Def/Implementation/DebuggerIntelliSense/DebuggerIntellisenseFilter.cs
...tation/DebuggerIntelliSense/DebuggerIntellisenseFilter.cs
+3
-0
src/VisualStudio/Core/Def/Implementation/LanguageService/AbstractLanguageService`2.IVsImmediateStatementCompletion2.cs
...ractLanguageService`2.IVsImmediateStatementCompletion2.cs
+4
-6
未找到文件。
src/VisualStudio/Core/Def/Implementation/DebuggerIntelliSense/AbstractDebuggerIntelliSenseContext.cs
浏览文件 @
6801607c
...
...
@@ -25,6 +25,7 @@ internal abstract class AbstractDebuggerIntelliSenseContext : IDisposable
{
private
readonly
IWpfTextView
_textView
;
private
readonly
IContentType
_contentType
;
private
readonly
IContentType
_originalContentType
;
protected
readonly
IProjectionBufferFactoryService
ProjectionBufferFactoryService
;
protected
readonly
Microsoft
.
VisualStudio
.
TextManager
.
Interop
.
TextSpan
CurrentStatementSpan
;
private
readonly
IVsTextLines
_debuggerTextLines
;
...
...
@@ -58,6 +59,7 @@ private class ImmediateWindowContext
this
.
ContextBuffer
=
contextBuffer
;
this
.
CurrentStatementSpan
=
currentStatementSpan
[
0
];
_contentType
=
contentType
;
_originalContentType
=
_textView
.
TextBuffer
.
ContentType
;
this
.
ProjectionBufferFactoryService
=
componentModel
.
GetService
<
IProjectionBufferFactoryService
>();
_bufferGraphFactoryService
=
componentModel
.
GetService
<
IBufferGraphFactoryService
>();
_isImmediateWindow
=
IsImmediateWindow
((
IVsUIShell
)
serviceProvider
.
GetService
(
typeof
(
SVsUIShell
)),
vsTextView
);
...
...
@@ -200,6 +202,12 @@ internal bool TryInitialize()
return
true
;
}
internal
void
SetContentType
(
bool
install
)
{
var
contentType
=
install
?
_contentType
:
_originalContentType
;
_textView
.
TextBuffer
.
ChangeContentType
(
contentType
,
null
);
}
private
ITrackingSpan
CreateImmediateWindowProjectionMapping
(
Document
document
,
out
ImmediateWindowContext
immediateWindowContext
)
{
var
caretLine
=
_textView
.
Caret
.
ContainingTextViewLine
.
Extent
;
...
...
src/VisualStudio/Core/Def/Implementation/DebuggerIntelliSense/DebuggerIntellisenseFilter.cs
浏览文件 @
6801607c
...
...
@@ -194,6 +194,9 @@ internal void RemoveContext()
_context
=
null
;
}
internal
void
SetContentType
(
bool
install
)
=>
_context
?.
SetContentType
(
install
);
public
void
Dispose
()
{
if
(
_context
!=
null
)
...
...
src/VisualStudio/Core/Def/Implementation/LanguageService/AbstractLanguageService`2.IVsImmediateStatementCompletion2.cs
浏览文件 @
6801607c
...
...
@@ -40,12 +40,7 @@ int IVsImmediateStatementCompletion2.InstallStatementCompletion(int install, IVs
if
(
install
!=
0
)
{
DebuggerIntelliSenseFilter
<
TPackage
,
TLanguageService
>
filter
;
if
(
this
.
filters
.
ContainsKey
(
textView
))
{
// We already have a filter in this textview. Return.
return
VSConstants
.
S_OK
;
}
else
if
(!
this
.
filters
.
ContainsKey
(
textView
))
{
filter
=
new
DebuggerIntelliSenseFilter
<
TPackage
,
TLanguageService
>(
this
,
this
.
EditorAdaptersFactoryService
.
GetWpfTextView
(
textView
),
...
...
@@ -55,10 +50,13 @@ int IVsImmediateStatementCompletion2.InstallStatementCompletion(int install, IVs
Marshal
.
ThrowExceptionForHR
(
textView
.
AddCommandFilter
(
filter
,
out
var
nextFilter
));
filter
.
SetNextFilter
(
nextFilter
);
}
this
.
filters
[
textView
].
SetContentType
(
install
:
true
);
}
else
{
Marshal
.
ThrowExceptionForHR
(
textView
.
RemoveCommandFilter
(
this
.
filters
[
textView
]));
this
.
filters
[
textView
].
SetContentType
(
install
:
false
);
this
.
filters
[
textView
].
Dispose
();
this
.
filters
.
Remove
(
textView
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录