Giter VIP home page Giter VIP logo

interactive-window's Introduction

Microsoft.VisualStudio.InteractiveWindow

Implementation of Visual Studio Interactive Window.

Build Status

interactive-window's People

Contributors

333fred avatar akoeplinger avatar alexandersher avatar brianaeng avatar cristianosuzuki77 avatar dotnet-bot avatar dotnet-maestro[bot] avatar genlu avatar jaredpar avatar jasonmalinowski avatar joerobich avatar jonfortescue avatar jordi1215 avatar mmitche avatar nguerrera avatar phil-allen-msft avatar ryzngard avatar sharwell avatar terrajobst avatar tmat avatar v-zbsail avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

interactive-window's Issues

Specify location of DLLs for C# Interactive

F# Interactive #help shows these options:

#r "file.dll";;        Reference (dynamically load) the given DLL
#I "path";;            Add the given search path for referenced DLLs
#load "file.fs" ...;;  Load the given file(s) as if compiled and referenced
#time ["on"|"off"];;   Toggle timing on/off
#help;;                Display help
#quit;;                Exit

F# Interactive command line options:

See 'fsi --help' for options

C# Interactive #help shows these options:

Keyboard shortcuts:
  Enter         If the current submission appears to be complete, evaluate it.  Otherwise, insert a new line.
  Escape        Clear the current submission.
  UpArrow       Replace the current submission with a previous submission.
  DownArrow     Replace the current submission with a subsequent submission (after having previously navigated backwards).
  Ctrl-C        Exit the REPL.
REPL commands:
  #help         Display help on available commands and key bindings.
Script directives:
  #r            Add a metadata reference to specified assembly and all its dependencies, e.g. #r "myLib.dll".
  #load         Load specified script file and execute it, e.g. #load "myScript.csx".

One of the great features of F# scripts is the #I directive, which tells F# Interactive where to look for referenced DLLs.

Is there an equivalent way to do this in C# scripts?

2.3.0 depends on VS assemblies that don't exist

Microsoft.VisualStudio.VsInteractiveWindow 2.3.0 depends on 
Microsoft.VisualStudio.Editor (>= 15.0.26201-alpha) but 
Microsoft.VisualStudio.Editor 15.0.26201-alpha was not found. 
An approximate best match of Microsoft.VisualStudio.Editor 15.0.26201 was resolved.

ditto others like

Microsoft.VisualStudio.VsInteractiveWindow 2.3.0 depends on
Microsoft.VisualStudio.ComponentModelHost (>= 15.0.26201-alpha)

Alt+Up and Alt+Down do not control history when interactive window launches pinned.

Reported at developer community as https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1178927.

Workflow:

  1. Open VS and dock the C# interactive window to one of the edges.
  2. Pin the window so that it collapses to a tab on the edge.
  3. Close VS
  4. Open VS
  5. Show the C# interactive window by clicking the tab
  6. Execute var a = 5;
  7. Press Alt + Up

Expected Outcome:

The current line should match the previous entry and read var a = 5;

Actual Outcome:

No change to the current line. From debugging the CommandFilter, pguidCmdGroup is VsStd12 and the nCmdID is MoveSelLinesUp.

Is csi.exe open-sourced?

Is csi.exe open-sourced somewhere? I don't know if it is appropriate to ask here but I'm quite curious about how csi is implemented.

Accessibility: Narrator issues

  1. Narrator identifies IW as 'text editor - readonly
  2. It does not read IW output. Say, 1+1 <ENTER> is read correctly but the resulting 2 is silent.

Calling interactive window methods from non-UI threads may lead to deadlock

When standard UI thread loop is replaced with JoinableTaskFactory job, Dispatcher.Invoke is blocked until job is completed. This may end up in a deadlock if calling code has switched from UI thread to background using СonfigureAwait(false) or any other custom awaiter.

Issue can be easily got around by calling all interactive window methods from UI thread, but it eliminates the advantage of calling IInteractiveWindow.Write from background thread. Maybe this method can use BeginInvoke instead.

Scenario: User inputs some command into interactive window. InteractiveEvaluator.ExecuteCodeAsync switches to background thread and waits until command is completed. Command produces some output which we have to print to user while it is coming. If command produces too much output and for each of it we have to create a task in Dispatcher, we get too many of them which is noticeable by user.

Allow specifying toolbar GUID and cmdid at creation

VS has a bug where toolbars (as identified by GUID/cmdid) appearing in multiple tool windows will share some visibility state for their icons. This results in icons added to the Python interactive appearing in the C# interactive:

image

VSPlat has acknowledged and wontfix'd the bug (you can also see it affect Solution Explorer if you open a second instance), and the best workaround for us is to have each user of the window provide their own toolbar.

Required assembly System.ComponentModel.TypeConverter v4.0.0 is not shipped with VS

Awaiting functions in my library causes the interactive window to hang. Running the same functions in csi.exe causes it to crash with the following error:

System.IO.FileNotFoundException: Could not load file or assembly 'System.ComponentModel.TypeConverter, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. File name: 'System.ComponentModel.TypeConverter, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' at System.Signature.GetSignature(Void* pCorSig, Int32 cCorSig, RuntimeFieldHandleInternal fieldHandle, IRuntimeMethodInfo methodHandle, RuntimeType declaringType) at System.Reflection.RuntimeMethodInfo.FetchNonReturnParameters() at System.Reflection.RuntimeMethodInfo.GetParameters() at Microsoft.CodeAnalysis.Scripting.Hosting.CommonObjectFormatter.FormatMethodSignature(MethodBase method) at Microsoft.CodeAnalysis.Scripting.Hosting.CommonObjectFormatter.FormatException(Exception e) at Microsoft.CodeAnalysis.Scripting.Hosting.CommandLineRunner.DisplayException(Exception e) at Microsoft.CodeAnalysis.Scripting.Hosting.CommandLineRunner.BuildAndRun(Script'1 newScript, InteractiveScriptGlobals globals, ScriptState'1& state, ScriptOptions& options, Boolean displayResult, CancellationToken cancellationToken) at Microsoft.CodeAnalysis.Scripting.Hosting.CommandLineRunner.RunInteractiveLoop(ScriptOptions options, String initialScriptCodeOpt, CancellationToken cancellationToken) at Microsoft.CodeAnalysis.Scripting.Hosting.CommandLineRunner.RunInteractiveCore(ErrorLogger errorLogger) at Microsoft.CodeAnalysis.Scripting.Hosting.CommandLineRunner.RunInteractive() at Microsoft.CodeAnalysis.CSharp.Scripting.Hosting.Csi.Main(String[] args)

WRN: Assembly binding logging is turned OFF. To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. Note: There is some performance penalty associated with assembly bind failure logging. To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog]

Running in the interactive window with assembly bind failure logging turned on returns the following error

Unexpected error: System.IO.FileNotFoundException: Could not load file or assembly 'System.ComponentModel.TypeConverter, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. File name: 'System.ComponentModel.TypeConverter, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' at System.Signature.GetSignature(Void* pCorSig, Int32 cCorSig, RuntimeFieldHandleInternal fieldHandle, IRuntimeMethodInfo methodHandle, RuntimeType declaringType) at System.Reflection.RuntimeMethodInfo.FetchNonReturnParameters() at System.Reflection.RuntimeMethodInfo.GetParameters() at Microsoft.CodeAnalysis.Scripting.Hosting.CommonObjectFormatter.FormatMethodSignature(MethodBase method) at Microsoft.CodeAnalysis.Scripting.Hosting.CommonObjectFormatter.FormatException(Exception e) at Microsoft.CodeAnalysis.CSharp.Scripting.Hosting.CSharpObjectFormatter.FormatException(Exception e) at Microsoft.CodeAnalysis.Interactive.InteractiveHost.Service.DisplayException(Exception e) at Microsoft.CodeAnalysis.Interactive.InteractiveHost.Service.<>c__DisplayClass42_0.<<ExecuteOnUIThread>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.CodeAnalysis.Interactive.InteractiveHost.Service.<ExecuteOnUIThread>d__42.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.CodeAnalysis.Interactive.InteractiveHost.Service.<ExecuteAsync>d__30.MoveNext()

Pre-bind state information

LOG: DisplayName = System.ComponentModel.TypeConverter, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a (Fully-specified)

LOG: Appbase = file:///C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/Common7/IDE/CommonExtensions/Microsoft/ManagedLanguages/VBCSharp/InteractiveComponents/

LOG: Initial PrivatePath = NULL Calling assembly : (Unknown).

LOG: This bind starts in default load context.

LOG: Using application configuration file: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\ManagedLanguages\VBCSharp\InteractiveComponents\InteractiveHost.exe.Config

LOG: Using host configuration file:

LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.

LOG: Post-policy reference: System.ComponentModel.TypeConverter, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a

LOG: The same bind was seen before, and was failed with hr = 0x80070002.

connect interactive window (repl) to entire project

Is there a way to navigate to a namespace and start using db or other server functions without having to include every dependency?

The Clojure repl allows you to call (in-ns 'my-db-namespace) and then I can call my database setup function. All dependencies are include when you navigate to the namespace. Currently, it looks like I have to include all .dlls when I am in a c# namespace. Is this feature possible? However, the Clojure repl compiles the program first before the interactive dev environment starts.

Thanks

VS 2022 C# interactive doesn't handle Korean input properly

This issue has been moved from a ticket on Developer Community.


[severity:It bothers me. A fix would be nice]

This report is for Visual Studio(I tried several times to report through VS&installer, but I failed. And It seems I can’t change the tag)

Dear VS Developers,

In VS 2022 17.7.5 interal C# interactive, it seems like Korean language input is not handled properly.
Letters are duplicated and split up as screenshot. When I tried C# interactive in Developers PowerShell for VS 2022, letters were displayed correctly.

Searching this problem, I have found former feedbacks that reported similar problems as below. And it hasn't been actually resolved.

[https://developercommunity.visualstudio.com/t/Typing-korean-strings-in-C-interactive/1331438]
[https://developercommunity.visualstudio.com/t/The-input-of-Korean-languages-need-to-be/306143]

Thank you.

screenshot 2023-10-23 103302.png


Original Comments

Feedback Bot on 10/22/2023, 07:54 PM:

(private comment, text removed)

sangig yeo on 10/24/2023, 00:18 AM:

(private comment, text removed)

sangig yeo on 10/24/2023, 01:10 AM:

(private comment, text removed)

sangig yeo on 10/26/2023, 05:39 AM:

(private comment, text removed)


Original Solutions

(no solutions)

Last 13 characters of error output in 'C# Interactive' window are not colored red

Moved from dotnet/roslyn#63317

Version Used: VS 17.3 (Roslyn 4.3.0.3-22401.3)

Steps to Reproduce:

  1. Open the "C# Interactive" window in VS.
  2. Submit any statement that results in error diagnostics.

Expected Behavior: All error diagnostics are colored correctly (red).

Actual Behavior: The last 13 characters are colored black, while the rest is colored correctly.

image

This does not affect csi in the console, which is always colored correctly.

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.