icsharpcode/ILSpy

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

Fermée

#1 293 ouverte le 6 oct. 2018

 (0 commentaire) (0 réaction) (0 personne assignée)C# (3 645 forks)batch import
Help WantedNew FeatureUI

Métriques du dépôt

Stars
 (25 162 étoiles)
Métriques de merge PR
 (Merge moyen 15j 22h) (61 PRs mergées en 30 j)

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.

Guide contributeur