Git Product home page Git Product logo

monodevelop-csharp-interactive's Introduction

C# interactive for MonoDevelop and Visual Studio for Mac

Provides a C# REPL to interact with the IDE.

Uses the .NET Interactive library:

https://github.com/dotnet/interactive

Which is used by dotnet repl:

https://github.com/jonsequitur/dotnet-repl

C# Interactive window

From the View menu select Pads - C# Interactive.

The C# Interactive window provides access to the C# REPL. The REPL is run in process with the IDE so you can access and interact with types running in the IDE.

C# Interactive window

Object Inspector window

From the C# REPL window when you use the #!inspect method the object passed will be open int the Object Inspector window.

Object Inpsector window

The Object Inspector window uses the tree view which is used by the debugger. It allows you to browse members of the object and update values such as strings and ints in the same way you can in the debugger.

monodevelop-csharp-interactive's People

Contributors

mrward avatar

Stargazers

Prateek Mahendrakar avatar Marius Ungureanu avatar

Watchers

 avatar James Cloos avatar  avatar

Forkers

therzok makiwolf

monodevelop-csharp-interactive's Issues

NullReferenceException in ClassifierTagger

Seeing this in VS Mac 17.1.

Failed assertion: System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.VisualStudio.Text.Classification.Implementation.ClassifierTagger.GetTags(NormalizedSnapshotSpanCollection spans)+MoveNext() in /Users/runner/work/1/s/src/Editor/Text/Impl/ClassificationAggregator/ClassifierTagger.cs:line 38
   at Microsoft.VisualStudio.Text.Tagging.Implementation.TagAggregator`1.GetTagsForBuffer(NormalizedSnapshotSpanCollection snapshotSpans, BufferState taggersForBuffer, ITextSnapshot root, Nullable`1 cancel)+MoveNext() in /Users/runner/work/1/s/src/Editor/Text/Impl/TagAggregator/TagAggregator.cs:line 494
   at Microsoft.VisualStudio.Editor.Implementation.ExtensionErrorHandler.Fail(System.String message)
   at Microsoft.VisualStudio.Editor.Implementation.ExtensionErrorHandler.HandleError(System.Object sender, System.Exception exception)
   at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.HandleException(System.Object errorSource, System.Exception e)
   at Microsoft.VisualStudio.Text.Tagging.Implementation.TagAggregator`1+<GetTagsForBuffer>d__49.MoveNext()
   at Microsoft.VisualStudio.Text.Classification.Implementation.ClassifierAggregator.InternalGetClassificationSpans(SnapshotSpan span, IEnumerable`1 tags)
   at Microsoft.VisualStudio.Text.Classification.Implementation.ClassifierAggregator.GetClassificationSpans(SnapshotSpan span)
   at Microsoft.VisualStudio.Text.Formatting.Implementation.CocoaNormalizedSpanGenerator.CreateClassifiedRuns(SnapshotSpan span, IAccurateClassifier classifier, ICocoaClassificationFormatMap classificationFormatMap, Nullable`1 cancel)
   at Microsoft.VisualStudio.Text.Formatting.Implementation.CocoaNormalizedSpanGenerator.Create(ITextAndAdornmentCollection elements, ITextSnapshot sourceSnapshot, IAccurateClassifier classifier, ICocoaClassificationFormatMap classificationFormatMap, Nullable`1 cancel)
   at Microsoft.VisualStudio.Text.Formatting.Implementation.CocoaFormattedLineSource.Microsoft.VisualStudio.Text.Formatting.ICocoaFormattedLineSource.FormatLineInVisualBuffer(ITextSnapshotLine visualLine, Nullable`1 cancel)
   at Microsoft.VisualStudio.Text.Editor.Implementation.BaseTextView.FormatSnapshotLine(ITextSnapshotLine visualLine, Nullable`1 cancel)
   at Microsoft.VisualStudio.Text.Editor.Implementation.BaseTextView+LayoutLineCache.DoAnchorFormat(SnapshotPoint anchorPosition, Nullable`1 cancel)
   at Microsoft.VisualStudio.Text.Editor.Implementation.BaseTextView.DoAnchorLayout(Microsoft.VisualStudio.Text.Editor.Implementation.LayoutDescription layout, SnapshotPoint anchorPosition, Double verticalDistance, Double topToBaselineDistance, ViewRelativePosition relativeTo, Nullable`1 cancel)
   at Microsoft.VisualStudio.Text.Editor.Implementation.BaseTextView.PerformLayout(ITextSnapshot newSnapshot, ITextSnapshot newVisualSnapshot, SnapshotPoint anchorPosition, Double verticalDistance, ViewRelativePosition relativeTo, Double effectiveViewportWidth, Double effectiveViewportHeight, Boolean preserveViewportTop, Nullable`1 cancel)
   at Microsoft.VisualStudio.Text.Editor.Implementation.BaseTextView.PerformLayout(ITextSnapshot newSnapshot, ITextSnapshot newVisualSnapshot)
   at Microsoft.VisualStudio.Text.Editor.Implementation.BaseTextView.AdvanceSnapshot(Microsoft.VisualStudio.Text.TextSnapshotChangedEventArgs e)
   at Microsoft.VisualStudio.Text.Editor.Implementation.BaseTextView.AdvanceSnapshotOnUIThread(Microsoft.VisualStudio.Text.TextSnapshotChangedEventArgs e)
   at Microsoft.VisualStudio.Text.Editor.Implementation.BaseTextView.OnVisualBufferChanged(System.Object sender, Microsoft.VisualStudio.Text.TextContentChangedEventArgs e)
   at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.RaiseEvent(System.Object sender, System.EventHandler`1 eventHandlers, Microsoft.VisualStudio.Text.Utilities.TArgs args)
   at Microsoft.VisualStudio.Text.Implementation.BaseBuffer.RawRaiseEvent(Microsoft.VisualStudio.Text.TextContentChangedEventArgs args, Boolean immediate)
   at Microsoft.VisualStudio.Text.Implementation.BaseBuffer+TextContentChangedEventRaiser.RaiseEvent(Microsoft.VisualStudio.Text.Implementation.BaseBuffer baseBuffer, Boolean immediate)
   at Microsoft.VisualStudio.Text.Implementation.BufferGroup.RaiseEvents()
   at Microsoft.VisualStudio.Text.Implementation.BufferGroup.FinishEdit()
   at Microsoft.VisualStudio.Text.Implementation.BaseBuffer+TextBufferEdit.Apply()
   at Microsoft.VisualStudio.Components.ConsoleViewController.WriteOutput(System.String text, Boolean allowEditing)
   at Microsoft.VisualStudio.Components.ConsoleViewController.WriteOutput(System.String text)
   at MonoDevelop.CSharpInteractive.CSharpInteractivePad.CreateConsoleView()
   at MonoDevelop.CSharpInteractive.CSharpInteractivePad.Initialize(IPadWindow window)
   at MonoDevelop.Ide.Gui.PadContent.Init(IPadWindow window)
   at MonoDevelop.Ide.Codons.PadCodon.InitializePadContent(IPadWindow window)
   at VisualStudioMac.UI.Pads.PadManager.CreatePadContent(Boolean force, MonoDevelop.Ide.Codons.PadCodon padCodon, VisualStudioMac.UI.Pads.PadWindow window, IDockItem item)
   at VisualStudioMac.UI.Pads.PadWindow.OnContentRequested()
   at VisualStudioMac.UI.Docking.DockItem.<get_Content>g__CreatePadContent|57_0()
   at VisualStudioMac.UI.Docking.DockItem.get_Content()
   at VisualStudioMac.UI.Docking.DockItem.LoadView()
   at System.RuntimeMethodHandle.InvokeMethod(System.Object target, Span`1 ByRef arguments, System.Signature sig, Boolean constructor, Boolean wrapExceptions)
   at System.Reflection.RuntimeMethodInfo.Invoke(System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture)
   at ObjCRuntime.Runtime.InvokeMethod(System.Reflection.MethodBase method, System.Object instance, IntPtr native_parameters)
   at ObjCRuntime.Runtime.InvokeMethod(ObjCRuntime.MonoObject* methodobj, ObjCRuntime.MonoObject* instanceobj, IntPtr native_parameters)
   at ObjCRuntime.Runtime.bridge_runtime_invoke_method(ObjCRuntime.MonoObject* method, ObjCRuntime.MonoObject* instance, IntPtr parameters, IntPtr ByRef exception_gchandle)
   at ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper(IntPtr receiver, IntPtr selector)
   at ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper(IntPtr receiver, IntPtr selector)
   at AppKit.NSViewController.get_View()
   at VisualStudioMac.UI.Docking.DockItemViewController..ctor(IDockFrame dockFrame, VisualStudioMac.UI.Docking.Model.DockLayoutItem dockObject, VisualStudioMac.UI.Docking.DockItem dockItem, Boolean createTabBar)
   at VisualStudioMac.UI.Docking.DockFrame.CreateViewControllerForItem(VisualStudioMac.UI.Docking.Model.DockLayoutItem o, IDockItem item)
   at VisualStudioMac.UI.Docking.DockFrame.LoadRecursive(VisualStudioMac.UI.Docking.Model.DockLayoutGroup group, System.Collections.Generic.List`1 controllers, System.Collections.Generic.List`1 dockBarItems)
   at VisualStudioMac.UI.Docking.DockFrame.LoadRecursive(VisualStudioMac.UI.Docking.Model.DockLayoutGroup group, System.Collections.Generic.List`1 controllers, System.Collections.Generic.List`1 dockBarItems)
   at VisualStudioMac.UI.Docking.DockFrame.LoadRecursive(VisualStudioMac.UI.Docking.Model.DockLayoutGroup group, System.Collections.Generic.List`1 controllers, System.Collections.Generic.List`1 dockBarItems)
   at VisualStudioMac.UI.Docking.DockFrame.LoadRecursive(VisualStudioMac.UI.Docking.Model.DockLayoutGroup group, System.Collections.Generic.List`1 controllers, System.Collections.Generic.List`1 dockBarItems)
   at VisualStudioMac.UI.Docking.DockFrame.LoadLayout(VisualStudioMac.UI.Docking.Model.DockLayoutModel layout)
   at VisualStudioMac.UI.Docking.DockFrame.LayoutChangedHandler(System.Object sender, VisualStudioMac.UI.Docking.LayoutChangedEventArgs args)
   at VisualStudioMac.UI.Docking.LayoutManager.set_CurrentLayout(System.String value)
   at VisualStudioMac.CocoaWorkbenchController.set_CurrentLayout(System.String value)
   at MonoDevelop.Ide.Gui.Workbench.SetCurrentLayout(System.String name)
   at MonoDevelop.Ide.Gui.Workbench.EnsureLayout()
   at MonoDevelop.Ide.Gui.Workbench.Present()
   at MonoDevelop.Ide.RootWorkspace+<OpenWorkspaceItem>d__109.MoveNext()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start(System.Runtime.CompilerServices.TStateMachine ByRef stateMachine)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.Start(System.Runtime.CompilerServices.TStateMachine ByRef stateMachine)
   at MonoDevelop.Ide.RootWorkspace.OpenWorkspaceItem(FilePath file, Boolean closeCurrent, Boolean loadPreferences, MonoDevelop.Ide.OpenWorkspaceItemMetadata metadata)
   at MonoDevelop.Ide.RootWorkspace.OpenWorkspaceItem(FilePath file, Boolean closeCurrent, Boolean loadPreferences)
   at MonoDevelop.Ide.RootWorkspace.OpenWorkspaceItem(FilePath file, Boolean closeCurrent)
   at MonoDevelop.Ide.RootWorkspace.OpenWorkspaceItem(FilePath file)
   at MonoDevelop.Ide.Projects.NewProjectDialogController+<OpenCreatedSolution>d__162.MoveNext()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start(System.Runtime.CompilerServices.TStateMachine ByRef stateMachine)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.Start(System.Runtime.CompilerServices.TStateMachine ByRef stateMachine)
   at MonoDevelop.Ide.Projects.NewProjectDialogController.OpenCreatedSolution(MonoDevelop.Ide.Templates.ProcessedTemplateResult templateResult)
   at MonoDevelop.Ide.Projects.NewProjectDialogController+<Create>d__143.MoveNext()
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1.MoveNext(System.Threading.Thread threadPoolThread)
   at System.Threading.Tasks.AwaitTaskContinuation+<>c.<.cctor>b__17_0(System.Object state)
   at System.Threading.Tasks.AwaitTaskContinuation.RunCallback(System.Threading.ContextCallback callback, System.Object state, System.Threading.Tasks.Task ByRef currentTask)
   at System.Threading.Tasks.SynchronizationContextAwaitTaskContinuation.Run(System.Threading.Tasks.Task task, Boolean canInlineContinuationTask)
   at System.Threading.Tasks.Task.RunContinuations(System.Object continuationObject)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.SetExistingTaskResult(System.Threading.Tasks.Task`1 task, System.Runtime.CompilerServices.TResult result)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.SetResult()
   at MonoDevelop.Ide.ProjectOperations+<SaveAsyncInternal>d__49.MoveNext()
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1.MoveNext(System.Threading.Thread threadPoolThread)
   at System.Threading.Tasks.AwaitTaskContinuation+<>c.<.cctor>b__17_0(System.Object state)
   at System.Threading.Tasks.AwaitTaskContinuation.RunCallback(System.Threading.ContextCallback callback, System.Object state, System.Threading.Tasks.Task ByRef currentTask)
   at System.Threading.Tasks.SynchronizationContextAwaitTaskContinuation.Run(System.Threading.Tasks.Task task, Boolean canInlineContinuationTask)
   at System.Threading.Tasks.Task.RunContinuations(System.Object continuationObject)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.SetExistingTaskResult(System.Threading.Tasks.Task`1 task, System.Runtime.CompilerServices.TResult result)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.SetResult()
   at MonoDevelop.Projects.WorkspaceItem+<>c__DisplayClass39_0+<<SaveAsync>b__0>d.MoveNext()
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1.MoveNext(System.Threading.Thread threadPoolThread)
   at System.Threading.Tasks.AwaitTaskContinuation+<>c.<.cctor>b__17_0(System.Object state)
   at System.Threading.Tasks.AwaitTaskContinuation.RunCallback(System.Threading.ContextCallback callback, System.Object state, System.Threading.Tasks.Task ByRef currentTask)
   at System.Threading.Tasks.SynchronizationContextAwaitTaskContinuation.Run(System.Threading.Tasks.Task task, Boolean canInlineContinuationTask)
   at System.Threading.Tasks.Task.RunContinuations(System.Object continuationObject)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.SetExistingTaskResult(System.Threading.Tasks.Task`1 task, System.Runtime.CompilerServices.TResult result)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.SetResult()
   at MonoDevelop.Projects.Solution+<OnSaveUserProperties>d__78.MoveNext()
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1.MoveNext(System.Threading.Thread threadPoolThread)
   at System.Threading.Tasks.SynchronizationContextAwaitTaskContinuation+<>c.<.cctor>b__8_0(System.Object state)
   at Foundation.NSAsyncSynchronizationContextDispatcher.Apply()
   at System.RuntimeMethodHandle.InvokeMethod(System.Object target, Span`1 ByRef arguments, System.Signature sig, Boolean constructor, Boolean wrapExceptions)
   at System.Reflection.RuntimeMethodInfo.Invoke(System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture)
   at ObjCRuntime.Runtime.InvokeMethod(System.Reflection.MethodBase method, System.Object instance, IntPtr native_parameters)
   at ObjCRuntime.Runtime.InvokeMethod(ObjCRuntime.MonoObject* methodobj, ObjCRuntime.MonoObject* instanceobj, IntPtr native_parameters)
   at ObjCRuntime.Runtime.bridge_runtime_invoke_method(ObjCRuntime.MonoObject* method, ObjCRuntime.MonoObject* instance, IntPtr parameters, IntPtr ByRef exception_gchandle)
   at AppKit.NSApplication.NSApplicationMain(Int32 argc, System.String[] argv)
   at AppKit.NSApplication.NSApplicationMain(Int32 argc, System.String[] argv)
   at AppKit.NSApplication.Main(System.String[] args)
   at VisualStudioMac.MainClass.Main(System.String[] args)

Does not open in VS Mac 17.4

Looks like the ConsoleInputEventArgs class has been made non-public.

ERROR [2022-07-27 15:15:56Z]: Could not create pad content
System.MethodAccessException: Attempt by method 'MonoDevelop.CSharpInteractive.CSharpInteractivePad.CreateConsoleView()' to access method 'System.EventHandler`1<System.__Canon>..ctor(System.Object, IntPtr)' failed.
   at MonoDevelop.CSharpInteractive.CSharpInteractivePad.CreateConsoleView()
   at MonoDevelop.CSharpInteractive.CSharpInteractivePad.Initialize(IPadWindow window)
   at MonoDevelop.Ide.Gui.PadContent.Init(IPadWindow window) in /Users/runner/work/1/s/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/PadContent.cs:line 76
   at MonoDevelop.Ide.Codons.PadCodon.InitializePadContent(IPadWindow window) in /Users/runner/work/1/s/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Codons/PadCodon.cs:line 89
   at VisualStudioMac.UI.Pads.PadManager.CreatePadContent(Boolean force, PadCodon padCodon, PadWindow window, IDockItem item) in /Users/runner/work/1/s/main/src/core/VisualStudio/UI/Pads/PadManager.cs:line 240
   at VisualStudioMac.UI.Pads.PadWindow.OnContentRequested() in /Users/runner/work/1/s/main/src/core/VisualStudio/UI/Pads/PadWindow.cs:line 277
   at VisualStudioMac.UI.Docking.DockItem.<get_Content>g__CreatePadContent|58_0() in /Users/runner/work/1/s/main/src/core/VisualStudio/UI/Docking/Cocoa/DockItem.cs:line 482
   at VisualStudioMac.UI.Docking.DockItem.get_Content() in /Users/runner/work/1/s/main/src/core/VisualStudio/UI/Docking/Cocoa/DockItem.cs:line 469
2022-07-27 15:15:56.085 VisualStudio[15806:263929] 

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.