0

Issue

If I use let with a long array in fsi, FSI outputs a lot of data:

- let abc = System.IO.Directory.GetFiles("c:/Windows/System32");;
val abc: string array =
  [|"c:/Windows/System32\07409496-a423-4a3e-b620-2cfb01a9318d_Hype"+[21 chars];
    "c:/Windows/System32\0ae3b998-9a38-4b72-a4c4-06849441518d_Serv"+[15 chars];
    "c:/Windows/System32\4545ffe2-0dc4-4df4-9d02-299ef204635e_hvsocket.dll";
    "c:/Windows/System32\69fe178f-26e7-43a9-aa7d-2b616b672dde_even"+[15 chars];
    "c:/Windows/System32\6bea57fb-8dfb-4177-9ae8-42e8b3529933_Runt"+[20 chars];
    "c:/Windows/System32\@AdvancedKeySettingsNotification.png";
    "c:/Windows/System32\@AppHelpToast.png";
    "c:/Windows/System32\@AudioToastIcon.png";
    "c:/Windows/System32\@BackgroundAccessToastIcon.png";
    "c:/Windows/System32\@bitlockertoastimage.png";
    "c:/Windows/System32\@edptoastimage.png";
    "c:/Windows/System32\@EnrollmentToastIcon.png";
    "c:/Windows/System32\@facial-recognition-windows-hello.gif";
    "c:/Windows/System32\@language_notification_icon.png";
    "c:/Windows/System32\@optionalfeatures.png";
    "c:/Windows/System32\@StorageSenseToastIcon.png";
    "c:/Windows/System32\@VpnToastIcon.png";
    "c:/Windows/System32\@WindowsHelloFaceToastIcon.png";
    "c:/Windows/System32\@WindowsUpdateToastIcon.contrast-black.png";
    "c:/Windows/System32\@WindowsUpdateToastIcon.contrast-white.png";
    "c:/Windows/System32\@WindowsUpdateToastIcon.png";
    "c:/Windows/System32\@WirelessDisplayToast.png";
    "c:/Windows/System32\@WLOGO_96x96.png";
    "c:/Windows/System32\aadauthhelper.dll";
    "c:/Windows/System32\aadcloudap.dll"; "c:/Windows/System32\aadjcsp.dll";
    "c:/Windows/System32\aadtb.dll"; "c:/Windows/System32\aadWamExtension.dll";
    "c:/Windows/System32\AarSvc.dll";
    "c:/Windows/System32\AboutSettingsHandlers.dll";
    "c:/Windows/System32\AboveLockAppHost.dll";
    "c:/Windows/System32\accessibilitycpl.dll";
    "c:/Windows/System32\accountaccessor.dll";
    "c:/Windows/System32\AccountsRt.dll"; "c:/Windows/System32\AcGenral.dll";
    "c:/Windows/System32\AcLayers.dll"; "c:/Windows/System32\acledit.dll";
    "c:/Windows/System32\aclui.dll"; "c:/Windows/System32\acm.bin";
    "c:/Windows/System32\acmigration.dll";
    "c:/Windows/System32\ACPBackgroundManagerPolicy.dll";
    "c:/Windows/System32\acppage.dll"; "c:/Windows/System32\acproxy.dll";
    "c:/Windows/System32\AcSpecfc.dll"; "c:/Windows/System32\ActionCenter.dll";
    "c:/Windows/System32\ActionCenterCPL.dll";
    "c:/Windows/System32\ActionQueue.dll";
    "c:/Windows/System32\ActivationClient.dll";
    "c:/Windows/System32\ActivationManager.dll";
    "c:/Windows/System32\activeds.dll"; "c:/Windows/System32\activeds.tlb";
    "c:/Windows/System32\ActiveHours.png";
    "c:/Windows/System32\ActiveSyncCsp.dll";
    "c:/Windows/System32\ActiveSyncProvider.dll";
    "c:/Windows/System32\actxprxy.dll"; "c:/Windows/System32\AcWinRT.dll";
    "c:/Windows/System32\AcXtrnal.dll"; "c:/Windows/System32\adal.dll";
    "c:/Windows/System32\AdaptiveCards.dll";
    "c:/Windows/System32\AddressParser.dll"; "c:/Windows/System32\adhapi.dll";
    "c:/Windows/System32\adhsvc.dll"; "c:/Windows/System32\AdmTmpl.dll";
    "c:/Windows/System32\adprovider.dll"; "c:/Windows/System32\adrclient.dll";
    "c:/Windows/System32\adsldp.dll"; "c:/Windows/System32\adsldpc.dll";
    "c:/Windows/System32\adsmsext.dll"; "c:/Windows/System32\adsnt.dll";
    "c:/Windows/System32\adtschema.dll";
    "c:/Windows/System32\AdvancedEmojiDS.dll";
    "c:/Windows/System32\advapi32.dll"; "c:/Windows/System32\advapi32res.dll";
    "c:/Windows/System32\advpack.dll"; "c:/Windows/System32\aeevts.dll";
    "c:/Windows/System32\aeinv.dll"; "c:/Windows/System32\aepic.dll";
    "c:/Windows/System32\agentactivationruntime.dll";
    "c:/Windows/System32\agentactivationruntimestarter.exe";
    "c:/Windows/System32\agentactivationruntimewindows.dll";
    "c:/Windows/System32\AgentService.exe";
    "c:/Windows/System32\AggregatorHost.exe";
    "c:/Windows/System32\aitstatic.exe"; "c:/Windows/System32\AJRouter.dll";
    "c:/Windows/System32\alg.exe"; "c:/Windows/System32\amcompat.tlb";
    "c:/Windows/System32\amsi.dll"; "c:/Windows/System32\amsiproxy.dll";
    "c:/Windows/System32\amstream.dll";
    "c:/Windows/System32\Analog.Shell.Broker.dll";
    "c:/Windows/System32\AnalogCommonProxyStub.dll";
    "c:/Windows/System32\apds.dll"; "c:/Windows/System32\APHostClient.dll";
    "c:/Windows/System32\APHostRes.dll";
    "c:/Windows/System32\APHostService.dll";
    "c:/Windows/System32\apisampling.dll";
    "c:/Windows/System32\ApiSetHost.AppExecutionAlias.dll";
    "c:/Windows/System32\apisetschema.dll"; "c:/Windows/System32\APMon.dll";
    "c:/Windows/System32\APMonUI.dll"; ...|]

Question

Is there a way to suppress the output for just that line?

Reasoning: Sometimes when I'm in VS Code (Ionide), I'll send a single line using alt-enter and it will output a lot of data as shown above. I then have to scroll back pretty far just to see previous lines. It would be nice to suppress the output for these kinds of let binding lines. If I want to see the output, I can always evaluate that name.

Comparison with PowerShell

If I assign a variable in PowerShell, the output is silent on the console:

PS C:\users\dharm\dropbox\documents> $abc = ls C:\Windows\System32
PS C:\users\dharm\dropbox\documents>

So that's the behavior I'm looking for with FSI.

dharmatech
  • 8,979
  • 8
  • 42
  • 88
  • 2
    One solution is to use `fsi.ShowDeclarationValues <- false`. After this line it still will print variable name and type, but won't print entire object. `fsi.ShowIEnumerable <- false` will disable printing only for sequences (including lists and arrays) – JL0PD May 31 '23 at 03:56
  • 1
    Related: https://stackoverflow.com/questions/5321031/how-does-fsi-showdeclarationvalues-work – JL0PD May 31 '23 at 03:57

0 Answers0