Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
836d6a26
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,发现更多精彩内容 >>
提交
836d6a26
编写于
3月 01, 2016
作者:
A
Artur Spychaj
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #9190 from drognanar/fixexecutecommands
[Ask Mode] Fix execute in interactive commands.
上级
6a006325
f35e56d0
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
37 addition
and
13 deletion
+37
-13
src/InteractiveWindow/VisualStudio/InteractiveWindow.vsct
src/InteractiveWindow/VisualStudio/InteractiveWindow.vsct
+16
-2
src/VisualStudio/Core/Def/Guids.cs
src/VisualStudio/Core/Def/Guids.cs
+5
-0
src/VisualStudio/Core/Def/ID.InteractiveCommands.cs
src/VisualStudio/Core/Def/ID.InteractiveCommands.cs
+4
-1
src/VisualStudio/Core/Def/Implementation/AbstractOleCommandTarget.Execute.cs
...re/Def/Implementation/AbstractOleCommandTarget.Execute.cs
+6
-5
src/VisualStudio/Core/Def/Implementation/AbstractOleCommandTarget.Query.cs
...Core/Def/Implementation/AbstractOleCommandTarget.Query.cs
+6
-5
未找到文件。
src/InteractiveWindow/VisualStudio/InteractiveWindow.vsct
浏览文件 @
836d6a26
...
...
@@ -53,7 +53,7 @@
<Group
guid=
"guidInteractiveWindowCmdSet"
id=
"ConsoleMenuClearGroup"
priority=
"0x300"
>
<Parent
guid=
"guidInteractiveWindowCmdSet"
id=
"menuIdInteractiveContextMenu"
/>
</Group>
<Group
guid=
"guidInteractiveWindowCmdSet"
id=
"TextEditorGroup"
priority=
"0x
101
"
>
<Group
guid=
"guidInteractiveWindowCmdSet"
id=
"TextEditorGroup"
priority=
"0x
370
"
>
<Parent
guid=
"guidSHLMainMenu"
id=
"IDM_VS_CTXT_CODEWIN"
/>
</Group>
</Groups>
...
...
@@ -231,6 +231,17 @@
-->
<!-- Text editor commands -->
<!-- TODO: Remove once https://github.com/dotnet/roslyn/issues/8927 is done. -->
<Button
guid=
"guidInteractiveWindowCmdSet"
id=
"cmdidExecuteInInteractiveWindow"
priority=
"0x101"
type=
"Button"
>
<Parent
guid=
"guidInteractiveWindowCmdSet"
id=
"TextEditorGroup"
/>
<CommandFlag>
DynamicVisibility
</CommandFlag>
<CommandFlag>
DefaultInvisible
</CommandFlag>
<Strings>
<ButtonText>
Execute in Interactive
</ButtonText>
<CanonicalName>
.InteractiveConsole.ExecuteInInteractive
</CanonicalName>
<LocCanonicalName>
.InteractiveConsole.ExecuteInInteractive
</LocCanonicalName>
</Strings>
</Button>
<Button
guid=
"guidInteractiveWindowCmdSet"
id=
"cmdidCopyToInteractiveWindow"
priority=
"0x102"
type=
"Button"
>
<CommandFlag>
DynamicVisibility
</CommandFlag>
...
...
@@ -285,7 +296,10 @@
<KeyBinding
guid=
"guidInteractiveWindowCmdSet"
id=
"cmdidSearchHistoryPrevious"
key1=
"VK_UP"
mod1=
"Control Alt"
editor=
"guidInteractiveWindow"
/>
<KeyBinding
guid=
"guidInteractiveWindowCmdSet"
id=
"cmdidCopyCode"
key1=
"C"
mod1=
"Control Shift"
editor=
"guidInteractiveWindow"
/>
<KeyBinding
guid=
"guidVSStd11"
id=
"cmdidExecuteSelectionInInteractive"
editor=
"guidCSharpEditorFactory"
mod1=
"Control"
key1=
"E"
mod2=
"Control"
key2=
"E"
/>
<!-- TODO: Revert to the code below pending https://github.com/dotnet/roslyn/issues/8927 .
<KeyBinding guid="guidVSStd11" id="cmdidExecuteSelectionInInteractive" editor="guidCSharpEditorFactory" mod1="Control" key1="E" mod2="Control" key2="E" />-->
<KeyBinding
guid=
"guidInteractiveWindowCmdSet"
id=
"cmdidExecuteInInteractiveWindow"
editor=
"guidCSharpEditorFactory"
mod1=
"Control"
key1=
"E"
key2=
"E"
/>
<KeyBinding
guid=
"guidInteractiveWindowCmdSet"
id=
"cmdidExecuteInInteractiveWindow"
editor=
"guidCSharpEditorFactory"
mod1=
"Control"
key1=
"E"
mod2=
"Control"
key2=
"E"
/>
<KeyBinding
guid=
"guidInteractiveWindowCmdSet"
id=
"cmdidCopyToInteractiveWindow"
editor=
"GUID_TextEditorFactory"
mod1=
"Control"
key1=
"K"
mod2=
"Control"
key2=
"VK_RETURN"
/>
</KeyBindings>
...
...
src/VisualStudio/Core/Def/Guids.cs
浏览文件 @
836d6a26
...
...
@@ -96,5 +96,10 @@ internal static class Guids
public
static
readonly
Guid
RoslynCommandSetId
=
new
Guid
(
RoslynCommandSetIdString
);
public
static
readonly
Guid
RoslynGroupId
=
new
Guid
(
RoslynGroupIdString
);
public
static
readonly
Guid
RoslynLibraryId
=
new
Guid
(
RoslynLibraryIdString
);
// TODO: Remove pending https://github.com/dotnet/roslyn/issues/8927 .
// Interactive guids
public
const
string
InteractiveCommandSetIdString
=
"00B8868B-F9F5-4970-A048-410B05508506"
;
public
static
readonly
Guid
InteractiveCommandSetId
=
new
Guid
(
InteractiveCommandSetIdString
);
}
}
src/VisualStudio/Core/Def/ID.InteractiveCommands.cs
浏览文件 @
836d6a26
...
...
@@ -2,7 +2,7 @@
using
System
;
namespace
Microsoft.VisualStudio.LanguageServices
.Implementation.Interactive
namespace
Microsoft.VisualStudio.LanguageServices
{
internal
static
partial
class
ID
{
...
...
@@ -11,6 +11,9 @@ internal static class InteractiveCommands
public
const
int
InteractiveToolWindow
=
0x0001
;
public
const
int
ResetInteractiveFromProject
=
0x0002
;
// TODO: Remove pending https://github.com/dotnet/roslyn/issues/8927 .
public
const
int
ExecuteInInteractiveWindow
=
0x0010C
;
public
static
readonly
string
CSharpInteractiveCommandSetIdString
=
"1492DB0A-85A2-4E43-BF0D-CE55B89A8CC6"
;
public
static
readonly
Guid
CSharpInteractiveCommandSetId
=
new
Guid
(
CSharpInteractiveCommandSetIdString
);
...
...
src/VisualStudio/Core/Def/Implementation/AbstractOleCommandTarget.Execute.cs
浏览文件 @
836d6a26
...
...
@@ -47,9 +47,9 @@ public virtual int Exec(ref Guid pguidCmdGroup, uint commandId, uint executeInfo
{
return
ExecuteVisualStudio97
(
ref
pguidCmdGroup
,
commandId
,
executeInformation
,
pvaIn
,
pvaOut
,
subjectBuffer
,
contentType
);
}
else
if
(
pguidCmdGroup
==
VSConstants
.
VsStd11
)
else
if
(
pguidCmdGroup
==
Guids
.
InteractiveCommandSetId
)
{
return
Execute
VisualStudio11
(
ref
pguidCmdGroup
,
commandId
,
executeInformation
,
pvaIn
,
pvaOut
,
subjectBuffer
,
contentType
);
return
Execute
Interactive
(
ref
pguidCmdGroup
,
commandId
,
executeInformation
,
pvaIn
,
pvaOut
,
subjectBuffer
,
contentType
);
}
else
if
(
pguidCmdGroup
==
VSConstants
.
VsStd14
)
{
...
...
@@ -570,7 +570,8 @@ private void ExecuteGoToPreviousMethod(ITextBuffer subjectBuffer, IContentType c
lastHandler
:
executeNextCommandTarget
);
}
private
int
ExecuteVisualStudio11
(
ref
Guid
pguidCmdGroup
,
uint
commandId
,
uint
executeInformation
,
IntPtr
pvaIn
,
IntPtr
pvaOut
,
ITextBuffer
subjectBuffer
,
IContentType
contentType
)
/// <remarks>TODO: Revert the change to use standard VS11 command pending https://github.com/dotnet/roslyn/issues/8927 .</remarks>
private
int
ExecuteInteractive
(
ref
Guid
pguidCmdGroup
,
uint
commandId
,
uint
executeInformation
,
IntPtr
pvaIn
,
IntPtr
pvaOut
,
ITextBuffer
subjectBuffer
,
IContentType
contentType
)
{
int
result
=
VSConstants
.
S_OK
;
var
guidCmdGroup
=
pguidCmdGroup
;
...
...
@@ -579,9 +580,9 @@ private int ExecuteVisualStudio11(ref Guid pguidCmdGroup, uint commandId, uint e
result
=
NextCommandTarget
.
Exec
(
ref
guidCmdGroup
,
commandId
,
executeInformation
,
pvaIn
,
pvaOut
);
};
switch
(
(
VSConstants
.
VSStd11CmdID
)
commandId
)
switch
(
commandId
)
{
case
VSConstants
.
VSStd11CmdID
.
ExecuteSelectionInInteractive
:
case
ID
.
InteractiveCommands
.
ExecuteInInteractiveWindow
:
ExecuteExecuteInInteractiveWindow
(
subjectBuffer
,
contentType
,
executeNextCommandTarget
);
break
;
...
...
src/VisualStudio/Core/Def/Implementation/AbstractOleCommandTarget.Query.cs
浏览文件 @
836d6a26
...
...
@@ -37,9 +37,9 @@ public int QueryStatus(ref Guid pguidCmdGroup, uint commandCount, OLECMD[] prgCm
{
return
QueryVisualStudio97Status
(
ref
pguidCmdGroup
,
commandCount
,
prgCmds
,
commandText
);
}
else
if
(
pguidCmdGroup
==
VSConstants
.
VsStd11
)
else
if
(
pguidCmdGroup
==
Guids
.
InteractiveCommandSetId
)
{
return
Query
VisualStudio11
Status
(
ref
pguidCmdGroup
,
commandCount
,
prgCmds
,
commandText
);
return
Query
Interactive
Status
(
ref
pguidCmdGroup
,
commandCount
,
prgCmds
,
commandText
);
}
else
if
(
pguidCmdGroup
==
VSConstants
.
VsStd14
)
{
...
...
@@ -224,11 +224,12 @@ private int QueryVisualStudio2000Status(ref Guid pguidCmdGroup, uint commandCoun
}
}
private
int
QueryVisualStudio11Status
(
ref
Guid
pguidCmdGroup
,
uint
commandCount
,
OLECMD
[]
prgCmds
,
IntPtr
commandText
)
/// <remarks>TODO: Revert the change to use standard VS11 command pending https://github.com/dotnet/roslyn/issues/8927 .</remarks>
private
int
QueryInteractiveStatus
(
ref
Guid
pguidCmdGroup
,
uint
commandCount
,
OLECMD
[]
prgCmds
,
IntPtr
commandText
)
{
switch
(
(
VSConstants
.
VSStd11CmdID
)
prgCmds
[
0
].
cmdID
)
switch
(
prgCmds
[
0
].
cmdID
)
{
case
VSConstants
.
VSStd11CmdID
.
ExecuteSelectionInInteractive
:
case
ID
.
InteractiveCommands
.
ExecuteInInteractiveWindow
:
return
QueryExecuteInInteractiveWindowStatus
(
ref
pguidCmdGroup
,
commandCount
,
prgCmds
,
commandText
);
;
default
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录