icsharpcode/ILSpy

Feature Request: Interative Run a method within a package (roslyn REPL)

Fechada

#1.293 aberto em 6 de out. de 2018

 (0 comentário) (0 reação) (0 responsável)C# (3.645 forks)batch import
Help WantedNew FeatureUI

Métricas do repositório

Stars
 (25.162 estrelas)
Métricas de merge de PR
 (Mesclagem média 15d 22h) (61 fundiu PRs em 30d)

Description

Roslyn made possible do run code interactively on dot net platform as REPL. Visual Studio later introduced a C# Interative Window to quickly run any piece of code without the painful work of setup a project just to evaluate a piece of code.

The idea of typing a code and evaluating the output is a common approach used by scripting languages that now is possible with c#.

https://github.com/dotnet/roslyn/wiki/C%23-Interactive-Walkthrough https://github.com/dotnet/roslyn/wiki/Interactive-Window

ILSpy could make a even better use of it if we could run any piece of code, without requiring to reference it in a project to wire up all dependencies.

There are a few tools using this feature already, follow a few to have an idea:

Having this feature on ILSpy would be handy, we could right click in a method, and 'Run it', ILSPy would arrange an interactive window with the basics to run a method already setup like the following:

#r "path/MyAssembly.dll"
using System;

var dependencyA = new Depdencency();
var obj = new ClassToTest();
obj.MethodClicked("required dummy data", dependencyA);

Or just the fact of having an interative window with the path (first line) set would be useful.

Guia do colaborador