Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit22fa934

Browse files
dungpalatkin
authored andcommitted
Remove 'Execute Line in F# Interactive' command
closesdotnet#260commitc272c8dAuthor: Anh-Dung Phan <phananhdung309@yahoo.com>Date: Tue Feb 24 11:46:09 2015 +0000 Remove unused stuffcommitaba396aAuthor: Anh-Dung Phan <phananhdung309@yahoo.com>Date: Sat Feb 21 12:49:11 2015 +0000 Fix a mistake in inactive codecommitc77e6f4Author: Anh-Dung Phan <phananhdung309@yahoo.com>Date: Sat Feb 21 12:42:13 2015 +0000 Remove 'Execute Line in F# Interactive' command
1 parentc6bbef5 commit22fa934

File tree

5 files changed

+10
-51
lines changed

5 files changed

+10
-51
lines changed

‎vsintegration/src/vs/FsPkgs/FSharp.LanguageService/FSharp.LanguageService.Base/ViewFilter.cs‎

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -423,10 +423,6 @@ protected virtual int QueryCommandStatus(ref Guid guidCmdGroup, uint nCmdId) {
423423
{
424424
return(int)OLECMDF.OLECMDF_SUPPORTED|(int)OLECMDF.OLECMDF_ENABLED;
425425
}
426-
elseif(nCmdId==(uint)Microsoft.VisualStudio.VSConstants.VSStd11CmdID.ExecuteLineInInteractive)
427-
{
428-
return(int)OLECMDF.OLECMDF_SUPPORTED|(int)OLECMDF.OLECMDF_ENABLED;
429-
}
430426
}
431427
#endif
432428
return(int)NativeMethods.E_FAIL;// delegate to next command target.
@@ -550,12 +546,7 @@ public virtual bool HandlePreExec(ref Guid guidCmdGroup, uint nCmdId, uint nCmde
550546
{
551547
if(nCmdId==(uint)Microsoft.VisualStudio.VSConstants.VSStd11CmdID.ExecuteSelectionInInteractive)
552548
{
553-
Microsoft.VisualStudio.FSharp.Interactive.Hooks.OnMLSend(GetProjectSystemPackage(),false,null,null);
554-
returntrue;
555-
}
556-
elseif(nCmdId==(uint)Microsoft.VisualStudio.VSConstants.VSStd11CmdID.ExecuteLineInInteractive)
557-
{
558-
Microsoft.VisualStudio.FSharp.Interactive.Hooks.OnMLSend(GetProjectSystemPackage(),true,null,null);
549+
Microsoft.VisualStudio.FSharp.Interactive.Hooks.OnMLSend(GetProjectSystemPackage(),null,null);
559550
returntrue;
560551
}
561552
}

‎vsintegration/src/vs/FsPkgs/FSharp.VS.FSI/fsiBasis.fs‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,11 @@ module internal Guids =
6060
letguidInteractive= Microsoft.VisualStudio.VSConstants.VsStd11
6161
letcmdIDSendSelection= int Microsoft.VisualStudio.VSConstants.VSStd11CmdID.ExecuteSelectionInInteractive
6262
letguidInteractive2= Microsoft.VisualStudio.VSConstants.VsStd11
63-
letcmdIDSendLine= int Microsoft.VisualStudio.VSConstants.VSStd11CmdID.ExecuteLineInInteractive
6463
#else
6564
// hybrid still uses own commands
6665
letguidInteractive= Guid("8B9BF77B-AF94-4588-8847-2EB2BFFD29EB")
6766
letcmdIDSendSelection=0x01
6867
letguidInteractive2= Guid("B607E86C-A761-4685-8D98-71A3BB73233A")
69-
letcmdIDSendLine=0x01
7068
#endif
7169

7270
letguidFsiPackage="eeeeeeee-9342-42f1-8ea9-42f0e8a6be55"// FSI-LINKAGE-POINT: when packaged here

‎vsintegration/src/vs/FsPkgs/FSharp.VS.FSI/fsiCommands.vsct‎

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@
119119
<!-- The following places a button on the F# Editor Context Menu-->
120120
<!-- In Dev11, shell now has
121121
<Button guid ="guidVSStd11" id ="cmdidExecuteSelectionInInteractive" priority ="0x100" type ="Button">
122-
<Button guid ="guidVSStd11" id ="cmdidExecuteLineInInteractive" priority ="0x105" type ="Button">
123122
-->
124123
<!-- In Dev10 hybrid, we need buttons below-->
125124
<ButtonCondition="!Defined(FX_ATLEAST_45)" guid ="guidInteractive" id ="cmdidSendSelection" priority ="0x100" type ="Button">
@@ -131,15 +130,6 @@
131130
</Strings>
132131
<CommandFlag>DynamicVisibility | DefaultInvisible</CommandFlag>
133132
</Button>
134-
<ButtonCondition="!Defined(FX_ATLEAST_45)" guid ="guidInteractive2" id ="cmdidSendLine" priority ="0x101" type ="Button">
135-
<Parentguid="guidSHLMainMenu"id="IDG_VS_CODEWIN_LANGUAGE"/>
136-
<Iconguid="guidFsiConsoleBmp"id="bmpConsole"/>
137-
<Strings>
138-
<ButtonText>Send Line To Interactive</ButtonText>
139-
<CommandName>Interactive.Send.Line.Context</CommandName>
140-
</Strings>
141-
<CommandFlag>DynamicVisibility | DefaultInvisible</CommandFlag>
142-
</Button>
143133

144134
</Buttons>
145135

@@ -241,10 +231,6 @@
241231
<KeyBindingCondition="!Defined(FX_ATLEAST_45)"guid="guidInteractive"id="cmdidSendSelection"editor="GUID_TextEditorFactory"key1="VK_RETURN"mod1="Alt" />
242232
<KeyBindingCondition="Defined(FX_ATLEAST_45)" guid ="guidVSStd11" id ="cmdidExecuteSelectionInInteractive"editor="GUID_TextEditorFactory"key1="VK_RETURN"mod1="Alt" />
243233

244-
<!-- VK_OEM_7 is the ' mark-->
245-
<KeyBindingCondition="!Defined(FX_ATLEAST_45)"guid="guidInteractive2"id="cmdidSendLine"editor="GUID_TextEditorFactory"key1="VK_OEM_7"mod1="Alt" />
246-
<KeyBindingCondition="Defined(FX_ATLEAST_45)" guid ="guidVSStd11" id ="cmdidExecuteLineInInteractive"editor="GUID_TextEditorFactory"key1="VK_OEM_7"mod1="Alt" />
247-
248234
<!-- CRTL-ALT-F for FSI window - following similar bindings for "other windows"-->
249235
<KeyBindingguid="guidFsiPackageCmdSet"id="cmdidFsiToolWindow"editor="guidVSStd97"key1="F"mod1="Control Alt" />
250236

@@ -312,7 +298,6 @@
312298

313299
<GuidSymbolname="guidVSStd11"value="{D63DB1F0-404E-4B21-9648-CA8D99245EC3}" >
314300
<IDSymbolname="cmdidExecuteSelectionInInteractive" value ="0x018"/>
315-
<IDSymbolname="cmdidExecuteLineInInteractive" value ="0x019"/>
316301
<IDSymbolname="cmdidInteractiveSessionInterrupt" value ="0x01A"/>
317302
<IDSymbolname="cmdidInteractiveSessionRestart" value ="0x01B"/>
318303
</GuidSymbol>
@@ -321,10 +306,7 @@
321306
<GuidSymbolCondition="!Defined(FX_ATLEAST_45)"name="guidInteractive"value="{8B9BF77B-AF94-4588-8847-2EB2BFFD29EB}" >
322307
<IDSymbolname="cmdidSendSelection" value ="0x01"/>
323308
</GuidSymbol>
324-
<GuidSymbolCondition="!Defined(FX_ATLEAST_45)"name="guidInteractive2"value="{B607E86C-A761-4685-8D98-71A3BB73233A}" >
325-
<IDSymbolname="cmdidSendLine" value ="0x01"/>
326-
</GuidSymbol>
327-
309+
328310
</Symbols>
329311

330312
</CommandTable>

‎vsintegration/src/vs/FsPkgs/FSharp.VS.FSI/fsiPackageHooks.fs‎

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -69,17 +69,14 @@ module internal Hooks =
6969
with e2->
7070
(System.Windows.Forms.MessageBox.Show(VFSIstrings.SR.exceptionRaisedWhenRequestingToolWindow(e2.ToString()))|> ignore)
7171

72-
letOnMLSend(this:Package)(selectLine:bool)(sender:obj)(e:EventArgs)=
73-
withFSIToolWindow this(fun window->
74-
if selectLinethen window.MLSendLine(sender,e)
75-
else window.MLSend(sender,e)
76-
)
72+
letOnMLSend(this:Package)(sender:obj)(e:EventArgs)=
73+
withFSIToolWindow this(fun window-> window.MLSend(sender, e))
7774

7875
letAddReferencesToFSI(this:Package)references=
7976
withFSIToolWindow this(fun window-> window.AddReferences references)
8077

8178
// FxCop request this function not be public
82-
letprivatesupportWhenFSharpDocument(selectLine:bool)(sender:obj)(e:EventArgs)=
79+
letprivatesupportWhenFSharpDocument(sender:obj)(e:EventArgs)=
8380
letcommand= sender:?> OleMenuCommand
8481
if command<>nullthen
8582
letlooksLikeFSharp,haveSelection=
@@ -135,12 +132,8 @@ module internal Hooks =
135132
// Add OLECommand to OleCommandTarget at the package level,
136133
// for when it is fired from other contexts, e.g. text editor.
137134
letid=new CommandID(Guids.guidInteractive,int32 Guids.cmdIDSendSelection)
138-
letcmd=new OleMenuCommand(new EventHandler(OnMLSend thisfalse), id)
139-
cmd.BeforeQueryStatus.AddHandler(new EventHandler(supportWhenFSharpDocumentfalse))
135+
letcmd=new OleMenuCommand(new EventHandler(OnMLSend this), id)
136+
cmd.BeforeQueryStatus.AddHandler(new EventHandler(supportWhenFSharpDocument))
140137
commandService.AddCommand(cmd)
141138

142-
letid=new CommandID(Guids.guidInteractive2,int32 Guids.cmdIDSendLine)
143-
letcmd=new OleMenuCommand(new EventHandler(OnMLSend thistrue), id)
144-
cmd.BeforeQueryStatus.AddHandler(new EventHandler(supportWhenFSharpDocumenttrue))
145-
commandService.AddCommand(cmd)
146139
#endif

‎vsintegration/src/vs/FsPkgs/FSharp.VS.FSI/fsiSessionToolWindow.fs‎

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -448,14 +448,14 @@ type internal FsiToolWindow() as this =
448448
letinteraction="\n"+ directiveA+"\n"+ directiveB+"\n"+ text+"\n"+ directiveC+"\n;;\n"
449449
executeTextNoHistory interaction
450450

451-
letsendSelectionToFSI(selectLine:bool)=
451+
letsendSelectionToFSI()=
452452
try
453453
// REVIEW: See supportWhenFSharpDocument for alternative way of obtaining selection, via IVs APIs.
454454
// Change post CTP.
455455
letdte= provider.GetService(typeof<DTE>):?> DTE
456456
letactiveD= dte.ActiveDocument
457457
match activeD.Selectionwith
458-
|:? TextSelectionas selectionwhenselectLine||selection.Text=""->
458+
|:? TextSelectionas selectionwhen selection.Text=""->
459459
selection.SelectLine()
460460
showNoActivate()
461461
executeInteraction(System.IO.Path.GetDirectoryName(activeD.FullName)) activeD.FullName selection.TopLine selection.Text
@@ -472,11 +472,8 @@ type internal FsiToolWindow() as this =
472472
// REVIEW: log error into Trace.
473473
// Example errors include no active document.
474474

475-
letonMLSendLine(sender:obj)(e:EventArgs)=
476-
sendSelectionToFSI(true)
477-
478475
letonMLSend(sender:obj)(e:EventArgs)=
479-
sendSelectionToFSI(false)
476+
sendSelectionToFSI()
480477
(*
481478
// Remove: after next submit (passing through SD)
482479
// The below did not work, so move to use Automatic API via DTE above...
@@ -529,7 +526,6 @@ type internal FsiToolWindow() as this =
529526
do this.Caption<- VFSIstrings.SR.fsharpInteractive()
530527

531528
memberthis.MLSend(obj,e)= onMLSend obj e
532-
memberthis.MLSendLine(obj,e)= onMLSendLine obj e
533529
memberthis.AddReferences(references:string[])=
534530
lettext=
535531
references
@@ -600,7 +596,6 @@ type internal FsiToolWindow() as this =
600596
addCommand Guids.guidInteractiveCommands Guids.cmdIDSessionRestart onRestart None
601597

602598
addCommand Guids.guidInteractive Guids.cmdIDSendSelection onMLSend None
603-
addCommand Guids.guidInteractive2 Guids.cmdIDSendLine onMLSendLine None
604599

605600
addCommand guidVSStd2KCmdID(int32 VSConstants.VSStd2KCmdID.UP) onHistory(Some supportWhenInInputArea)
606601
addCommand guidVSStd2KCmdID(int32 VSConstants.VSStd2KCmdID.DOWN) onHistory(Some supportWhenInInputArea)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp