Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
fed49cfd
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,发现更多精彩内容 >>
提交
fed49cfd
编写于
6月 27, 2018
作者:
T
Tomas Matousek
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Make immediate window buffer writable before applying completion edit
上级
11e5b433
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
39 addition
and
3 deletion
+39
-3
src/EditorFeatures/Core/IDebuggerTextView.cs
src/EditorFeatures/Core/IDebuggerTextView.cs
+4
-0
src/EditorFeatures/Core/Implementation/IntelliSense/Completion/Controller_Commit.cs
...plementation/IntelliSense/Completion/Controller_Commit.cs
+15
-0
src/VisualStudio/Core/Def/Implementation/DebuggerIntelliSense/AbstractDebuggerIntelliSenseContext.cs
...buggerIntelliSense/AbstractDebuggerIntelliSenseContext.cs
+1
-1
src/VisualStudio/Core/Def/Implementation/DebuggerIntelliSense/DebuggerTextView.cs
...f/Implementation/DebuggerIntelliSense/DebuggerTextView.cs
+19
-2
未找到文件。
src/EditorFeatures/Core/IDebuggerTextView.cs
浏览文件 @
fed49cfd
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using
System
;
using
Microsoft.VisualStudio.Language.Intellisense
;
namespace
Microsoft.CodeAnalysis.Editor
...
...
@@ -9,5 +10,8 @@ internal interface IDebuggerTextView
bool
IsImmediateWindow
{
get
;
}
void
HACK_StartCompletionSession
(
IIntellisenseSession
editorSessionOpt
);
uint
StartBufferUpdate
();
void
EndBufferUpdate
(
uint
cookie
);
}
}
src/EditorFeatures/Core/Implementation/IntelliSense/Completion/Controller_Commit.cs
浏览文件 @
fed49cfd
...
...
@@ -114,6 +114,16 @@ private CompletionProvider GetCompletionProvider(CompletionItem item)
var
adjustedNewText
=
AdjustForVirtualSpace
(
textChange
);
var
editOptions
=
GetEditOptions
(
mappedSpan
,
adjustedNewText
);
// The immediate window is always marked read-only and the language service is
// responsible for asking the buffer to make itself writable. We'll have to do that for
// commit, so we need to drag the IVsTextLines around, too.
// We have to ask the buffer to make itself writable, if it isn't already
uint
immediateWindowBufferUpdateCookie
=
0
;
if
(
_isImmediateWindow
)
{
immediateWindowBufferUpdateCookie
=
((
IDebuggerTextView
)
TextView
).
StartBufferUpdate
();
}
// Now actually make the text change to the document.
using
(
var
textEdit
=
this
.
SubjectBuffer
.
CreateEdit
(
editOptions
,
reiteratedVersionNumber
:
null
,
editTag
:
null
))
{
...
...
@@ -121,6 +131,11 @@ private CompletionProvider GetCompletionProvider(CompletionItem item)
textEdit
.
ApplyAndLogExceptions
();
}
if
(
_isImmediateWindow
)
{
((
IDebuggerTextView
)
TextView
).
EndBufferUpdate
(
immediateWindowBufferUpdateCookie
);
}
// If the completion change requested a new position for the caret to go,
// then set the caret to go directly to that point.
if
(
completionChange
.
NewPosition
.
HasValue
)
...
...
src/VisualStudio/Core/Def/Implementation/DebuggerIntelliSense/AbstractDebuggerIntelliSenseContext.cs
浏览文件 @
fed49cfd
...
...
@@ -195,7 +195,7 @@ internal bool TryInitialize()
var
bufferGraph
=
_bufferGraphFactoryService
.
CreateBufferGraph
(
_projectionBuffer
);
_debuggerTextView
=
new
DebuggerTextView
(
_textView
,
bufferGraph
,
this
.
InImmediateWindow
);
_debuggerTextView
=
new
DebuggerTextView
(
_textView
,
bufferGraph
,
_debuggerTextLines
,
InImmediateWindow
);
return
true
;
}
...
...
src/VisualStudio/Core/Def/Implementation/DebuggerIntelliSense/DebuggerTextView.cs
浏览文件 @
fed49cfd
...
...
@@ -12,6 +12,7 @@
using
Microsoft.VisualStudio.Text.Formatting
;
using
Microsoft.VisualStudio.Text.Outlining
;
using
Microsoft.VisualStudio.Text.Projection
;
using
Microsoft.VisualStudio.TextManager.Interop
;
using
Microsoft.VisualStudio.Utilities
;
using
Roslyn.Utilities
;
...
...
@@ -23,15 +24,18 @@ internal partial class DebuggerTextView : IWpfTextView, IDebuggerTextView
/// The actual debugger view of the watch or immediate window that we're wrapping
/// </summary>
private
readonly
IWpfTextView
_innerTextView
;
private
readonly
IVsTextLines
_debuggerTextLines
;
public
DebuggerTextView
(
IWpfTextView
innerTextView
,
IBufferGraph
bufferGraph
,
IVsTextLines
debuggerTextLines
,
bool
isImmediateWindow
)
{
_innerTextView
=
innerTextView
;
this
.
BufferGraph
=
bufferGraph
;
this
.
IsImmediateWindow
=
isImmediateWindow
;
_debuggerTextLines
=
debuggerTextLines
;
BufferGraph
=
bufferGraph
;
IsImmediateWindow
=
isImmediateWindow
;
}
/// <summary>
...
...
@@ -60,6 +64,19 @@ public bool IsImmediateWindow
get
;
}
public
uint
StartBufferUpdate
()
{
_debuggerTextLines
.
GetStateFlags
(
out
var
bufferFlags
);
_debuggerTextLines
.
SetStateFlags
((
uint
)((
BUFFERSTATEFLAGS
)
bufferFlags
&
~
BUFFERSTATEFLAGS
.
BSF_USER_READONLY
));
return
bufferFlags
;
}
public
void
EndBufferUpdate
(
uint
cookie
)
{
_debuggerTextLines
.
SetStateFlags
(
cookie
);
}
public
ITextCaret
Caret
{
get
{
return
_innerTextView
.
Caret
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录