icsharpcode/ILSpy

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

クローズ

#1,293 opened on 2018/10/06

 (0 件のコメント) (0 件のリアクション) (0 人の担当者)C# (3,645 件のフォーク)batch import
Help WantedNew FeatureUI

Repository metrics

Stars
 (25,162 個のスター)
PR merge metrics
 (平均マージ 15d 22h) (30d で 61 merged PRs)

説明

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.

コントリビューターガイド