Giter Club home page Giter Club logo

csharprepl's People

Contributors

aixasz avatar atifaziz avatar dependabot[bot] avatar ibit-zee avatar keyros avatar kindermannhubert avatar lonix1 avatar sf-mregenhardt avatar vndpal avatar waf 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  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

csharprepl's Issues

History should be filtered by text on the current line

Feature Description

Currently, when pressing Up in the prompt, the immediately previous history entry will be selected.

Rather than using the immediately previous history entry, it should use the previous history entry that starts with the text currently on the prompt.

For example, pressing Up in the following scenario should select the Console.WriteLine entry as it starts with C:

> Console.WriteLine("Hello World")

> var x = 5;

> C|

Essentially, we want the PSReadLine HistorySearchBackward style behavior.

CSharpRepl doesn't work on .NET 6 Preview ("Version string portion was too short or too long")

Hello!

When I start CSharpRepl I'm presented with this error:

One or more errors occurred. (Version string portion was too short or too long. (Parameter 'input'))

Attempting to type any character results in this exception:

> Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object.
   at CSharpRepl.Services.Roslyn.RoslynServices.Complete(String text, Int32 caret) in C:\Users\will.fuqua\source\repos\Sharply\CSharpRepl.Services\Roslyn\RoslynServices.cs:line 88
   at CSharpRepl.Prompt.PromptConfiguration.<>c__DisplayClass0_0.<<Create>g__completionHandler|0>d.MoveNext() in C:\Users\will.fuqua\source\repos\Sharply\CSharpRepl\Prompt\PromptConfiguration.cs:line 42
--- End of stack trace from previous location ---
   at PrettyPrompt.Panes.CompletionPane.PrettyPrompt.Consoles.IKeyPressHandler.OnKeyUp(KeyPress key)
   at PrettyPrompt.Prompt.InterpretKeyPress(KeyPress key, CodePane codePane, CompletionPane completionPane)
   at PrettyPrompt.Prompt.ReadLineAsync(String prompt)
   at CSharpRepl.Program.RunPrompt(Configuration config) in C:\Users\will.fuqua\source\repos\Sharply\CSharpRepl\Program.cs:line 79
   at CSharpRepl.Program.Main(String[] args) in C:\Users\will.fuqua\source\repos\Sharply\CSharpRepl\Program.cs:line 42
   at CSharpRepl.Program.<Main>(String[] args)

However, it works fine on my laptop. A noteworthy difference between the two machines is that my desktop has .NET 6 Preview 4 installed while my laptop does not. Based on the error I'm assuming that's the culprit (something choking on the pre-release suffix?), but I did not have a chance to dig very far so that might be a red herring.

Flaky CI tests

Version

latest

What happened?

For my last commit:

  • Ubuntu job was ok, Windows failed.
  • On the second run, Ubuntu job failed and Windows was ok.
  • On the third run both were ok.

https://github.com/waf/CSharpRepl/runs/4680137856?check_suite_focus=true

In both cases it failed with following:

Run dotnet test --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
Build started 1/1/2022 4:38:14 PM.
1>Project "D:\a\CSharpRepl\CSharpRepl\CSharpRepl.sln" on node 1 (VSTest target(s)).
1>ValidateSolutionConfiguration:
Building solution configuration "Debug|Any CPU".
Test run for D:\a\CSharpRepl\CSharpRepl\CSharpRepl.Tests\bin\Debug\net6.0\CSharpRepl.Tests.dll (.NETCoreApp,Version=v6.0)
Microsoft (R) Test Execution Command Line Tool Version 17.0.0
Copyright (c) Microsoft Corporation. All rights reserved.

Starting test execution, please wait...
A total of 1 test files matched the specified pattern.

Writing trace log to C:\Users\runneradmin\AppData\Local\Temp\tmp569E.tmp

Writing trace log to C:\Users\runneradmin\AppData\Local\Temp\tmp56BE.tmp

[xUnit.net 00:00:49.35] CSharpRepl.Tests.ReadEvalPrintLoopTests.RunAsync_LoadScript_RunsScript [FAIL]
Failed CSharpRepl.Tests.ReadEvalPrintLoopTests.RunAsync_LoadScript_RunsScript [14 ms]
Error Message:
System.InvalidOperationException : Failed to apply edit to workspace
Stack Trace:
at CSharpRepl.Services.Extensions.RoslynExtensions.ApplyChanges(Solution edit, Workspace workspace) in D:\a\CSharpRepl\CSharpRepl\CSharpRepl.Services\Extensions\RoslynExtensions.cs:line 16
at CSharpRepl.Services.Roslyn.WorkspaceManager.UpdateCurrentDocument(Success result) in D:\a\CSharpRepl\CSharpRepl\CSharpRepl.Services\Roslyn\WorkspaceManager.cs:line 73
at CSharpRepl.Services.Roslyn.RoslynServices.EvaluateAsync(String input, String[] args, CancellationToken cancellationToken) in D:\a\CSharpRepl\CSharpRepl\CSharpRepl.Services\Roslyn\RoslynServices.cs:line 95
at CSharpRepl.ReadEvalPrintLoop.Preload(RoslynServices roslyn, IConsole console, Configuration config) in D:\a\CSharpRepl\CSharpRepl\CSharpRepl\ReadEvalPrintLoop.cs:line 102
at CSharpRepl.ReadEvalPrintLoop.RunAsync(Configuration config) in D:\a\CSharpRepl\CSharpRepl\CSharpRepl\ReadEvalPrintLoop.cs:line 38
at CSharpRepl.Tests.ReadEvalPrintLoopTests.RunAsync_LoadScript_RunsScript() in D:\a\CSharpRepl\CSharpRepl\CSharpRepl.Tests\ReadEvalPrintLoopTests.cs:line 91
--- End of stack trace from previous location ---

Failed! - Failed: 1, Passed: 90, Skipped: 0, Total: 91, Duration: 59 s - CSharpRepl.Tests.dll (net6.0)
1>Done Building Project "D:\a\CSharpRepl\CSharpRepl\CSharpRepl.sln" (VSTest target(s)) -- FAILED.

Build FAILED.
0 Warning(s)
0 Error(s)

Time Elapsed 00:01:06.13
Error: Process completed with exit code 1.

NullReferenceException

Version

C# REPL 0.3.3

What happened?

Billion dollar exception(NullReferenceException)

Windows specifications:
Edition Windows 10 Pro
Version 21H1
OS build 19043.1165
Experience Windows Feature Experience Pack 120.2212.3530.0

System type 64-bit operating system

Steps to reproduce:

  • dotnet tool install -g csharprepl
  • charprepl
  • type any key. example: f

image

Roslyn's completion trigger

Maybe (haven't tried yet but by description looks promising) we should use
CompletionService.ShouldTriggerCompletion
in
PromptCallbacks.OpenCompletionWindowCallback
instead of a custom heuristic from PrettyPrompt.

intellisense area is hidden

hello, this project is pretty cool. 🤩

when type in the bottom of terminal, intellisense area is hidden 👇
image

Missing item descriptions after dot

Version

last

What happened?

"".Where()
place caret after . and trigger completion list. All listed items miss description.
The reason is that in AutoCompleteService.GetExtendedDescriptionAsync text of completedDocument contains incorrectly completed text like "".WhereWhere(), "".AggregateWhere(), ...

This is a separate issue from #65 because the reasons for it are different.

"No such file or directory" error on adding reference to csproj file.

Version

C# REPL 0.3.0 and 0.2.9 on dotnet 5.0.302 on Ubuntu 20.10

What happened?

Trying to add a reference to my .csproj file produced the error message "No such file or directory". Trying to reference members from the project anyway fails with "error CS0103: The name {name} does not exist in the current context".

Minimal example:

$ dotnet new console -o myApp
The template "Console Application" was created successfully.

Processing post-creation actions...
Running 'dotnet restore' on myApp/myApp.csproj...
  Determining projects to restore...
  Restored ~/csharp/hello/myApp/myApp.csproj (in 87 ms).
Restore succeeded.

$ cd myApp
$ dotnet run
Hello World!
$ ls
bin  myApp.csproj  obj  Program.cs
$ csharprepl -r myApp.csproj
Welcome to the C# REPL (Read Eval Print Loop)!
Type C# expressions and statements at the prompt and press Enter to evaluate them.
Type help to learn more, and type exit to quit.

Adding supplied references...
Building myApp.csproj
No such file or directory
> #r "myApp.csproj"
Building myApp.csproj
No such file or directory
> Main()
(1,1): error CS0103: The name 'Main' does not exist in the current context
> Program.Main()
(1,1): error CS0103: The name 'Program' does not exist in the current context
> myApp.Main()  
(1,1): error CS0103: The name 'myApp' does not exist in the current context
> myApp.Program.Main()
(1,1): error CS0103: The name 'myApp' does not exist in the current context

Using the full path to the file does not solve the problem.

Use Csharp Repl in other software

Feature Description

Dear @waf
I working with project open source in below but it working with python shell ,
https://github.com/chuongmep/CadPythonShell
I have a question, whether we can apply this project to build and upgrade CadPythonShell to support platform C# Shell or not.This project is only in net 4.8 and cannot go higher because the main software dependency they are working on is autocad
I would like to describe it in a little detail. They run in wpf and as a plugin inside an autocad. Any suggestions are greatly appreciated.
My research direction is to use https://github.com/roslynpad/roslynpad to do but I find they have too many bug in libraries, hope to get some advice from you.

Passing argument to .csx file

How to pass command line arguments to csx file. With dotnet-script I can do dotnet-script myfile.csx -- arg1 arg2. Is this supported in csharprepl? Thanks.

Ability to customize the prompt

Feature Description

Right now, the prompt is a simple > sign. It'd be nice to support customization of this prompt, either via a command line flag, an environment variable, or both. It should probably support ansi escape sequences for foreground/background colors.

The design of this could conflict with #23

Smart indentation

Feature Description

Automatically increase default indentation of new lines with every open {.
This would probably need support from PrettyPrompt.

It should also correctly cooperate with PrettyPrompt's "Smart Home" (waf/PrettyPrompt#38).

Add option to disable ForceSoftEnter override

Feature Description

When waf/PrettyPrompt#92 is done and used by CSharpRepl configuration we should add an option to disable the current ForceSoftEnter override.

E.g. I want to have it configured the way that Enter is always soft Enter and Ctrl+Enter is always hard Enter.

Remote Console For Web Applications

Feature Description

Nice work!!! I've been waiting for a cross-platform c# REPL, thanks!

A great feature addition would be the ability to "remote console" into running web applications such as is possible with other stack's REPLs (e.g. elixir/erlang). This is very convenient for confirming/tweaking service configurations and executing code for debugging issues. We use this extensively in our phoenix/elixir deployment (with care on production but very helpful for staging too). Obviously this exposes a security risk but can be locked down.

I imagine that the console would run locally and use tcp to send commands and print the results. It would be up to the end-users to ensure secure connections and proper authorization.

The critical piece is that the console should have fun access to the running system and state. Nice-to-haves would be to have access to the IServiceProvider to instantiate instances of services and inspect/set fields/properties or run methods.

Referencing .NET 6 WPF library causing null reference exception

Version

0.3.5

What happened?

AssemblyReferenceMetadataResolver.LoadSharedFramework
image

Content of runtimeconfig.json:

{
  "runtimeOptions": {
    "tfm": "net6.0",
    "frameworks": [
      {
        "name": "Microsoft.NETCore.App",
        "version": "6.0.0"
      },
      {
        "name": "Microsoft.WindowsDesktop.App",
        "version": "6.0.0"
      }
    ]
  }
}

The problem probably is that there is expected 'framework' instead of actual 'frameworks'.

Extreme slow down for longer inputs

Version

0.3.5

What happened?

For repro just insert:

1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 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1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1

and try to continue in writing.

VS highlighting theme

Feature Description

Hi,
I'd like to have Visual Studio Dark theme highlighting colors here.
I can prepare this but I'm not sure if you would prefer updating DefaultTheme (this would be my choice so familiar colors would be used out of the box) or if you would create new theme besides currently existing Dracula theme.

Add automatic variables that represent previously evaluated values

Feature Description

It'd be nice to have automatic variables that represent previous prompt results.

There are two possible approaches (they aren't mutually exclusive):

Counting Forwards

Count forwards from the start, e.g. line0, line1, line2, etc. We'd probably want to change the prompt from > to lineN > so it's easy to see what a given line would reference. A downside of this is that it's a more complex UI:

line0> 5 + 3
8
line1> 17 * 2
34
line2> line0 + line1
42

Probably want a command line switch to disable this feature, in case people don't want the extra noise.

Counting backwards

Have automatic variables that always represent the previous line, and the line before that (e.g. last, last2, etc).

  • A benefit of this is that it wouldn't require a change to the prompt
  • A downside is that it can get confusing to figure out what you've historically run, as the variables will have a different value on each line. It also somewhat breaks history, because if you run a line from history that references these last variables, the result will be different.

I'm currently planning to implement only Counting Forwards

To my knowledge, roslyn scripting does not support dynamically adding to the ScriptGlobals type, so it might be a bit tricky to implement. We'd also want to ensure that these lines show up in intellisense.

System.InvalidOperationException: failed to set output console mode, error code: 87

Version

0.3.3

What happened?

I try to start csharprepl from command prompt and I get:

Unhandled exception. System.InvalidOperationException: failed to set output console mode, error code: 87
   at PrettyPrompt.Consoles.SystemConsole.InitVirtualTerminalProcessing()
   at PrettyPrompt.Prompt..ctor(String persistentHistoryFilepath, PromptCallbacks callbacks, IConsole console)
   at CSharpRepl.Program.Main(String[] args) in C:\Users\will.fuqua\source\repos\CSharpRepl\CSharpRepl\Program.cs:line 3
8
   at CSharpRepl.Program.<Main>(String[] args)

I noticed someone else had reported this a few days ago, but their issue was that they were running it on Windows 7. In my case, I am running Windows 10 Build 19043.1237, but also getting this exception.

Add unit tests for soft-enter feature

Feature Description

It was broken (#68) and is fixed but we should add tests for following key-bindings configurations:

  • default configuration (Enter is submit for complete statements; Enter is new line for non-complete statements),
  • --newLineKeys Enter --submitPromptKeys Ctrl+Enter (feature has no effect; Enter is new line always; Ctrl+Enter is submit).

Missing item descriptions in some cases

Version

last

What happened?

Write datetime, close completion list, reopen it.
DateTime and probably all items with length <= DateTime length do not have a description.

From a quick look, it looks like infoService.GetQuickInfoAsync in AutoCompleteService.GetExtendedDescription returns null for cursor position at the end of the word.
CSharpRepl_ulueCBBC9t

Provide way to configure features

Feature Description

Would be nice if csharprepl had some configuration file.

Mainly I'd like to be able to configure key mappings. But there is (or will be) much more thing that could be configurable.

Could be probably done similarly like theme json.

Referencing an assembly in .NET 6.0 fails with System.ArgumentException

Version

6d46262

What happened?

Related to #8.

The fix for that issue (#9) wasn't applied everywhere, and the version string parsing fails again in AssemblyReferenceMetadataResolver.

var name = config.RuntimeOptions.Framework.Name;
var version = new Version(config.RuntimeOptions.Framework.Version);
referenceAssemblyService.LoadSharedFrameworkConfiguration(name, version);

System.ArgumentException: Version string portion was too short or too long. (Parameter 'input')
   at System.Version.ParseVersion(ReadOnlySpan`1 input, Boolean throwOnFailure)
   at System.Version.Parse(String input)
   at System.Version..ctor(String version)
   at CSharpRepl.Services.Roslyn.MetadataResolvers.AssemblyReferenceMetadataResolver.LoadSharedFramework(ImmutableArray`1 references)
   at CSharpRepl.Services.Roslyn.MetadataResolvers.AssemblyReferenceMetadataResolver.ResolveReference(String reference, String baseFilePath, MetadataReferenceProperties properties, MetadataReferenceResolver compositeResolver)
   at CSharpRepl.Services.Roslyn.MetadataResolvers.CompositeMetadata
ReferenceResolver.ResolveReference(String reference, String baseFilePath, MetadataReferenceProperties properties)
   at Microsoft.CodeAnalysis.CommonReferenceManager`2.ResolveReferenceDirective(String reference, Location location, TCompilation compilation)
   at Microsoft.CodeAnalysis.CommonReferenceManager`2.GetCompilationReferences(TCompilation compilation, DiagnosticBag diagnostics, ImmutableArray`1& references, IDictionary`2& boundReferenceDirectives, ImmutableArray`1& referenceDirectiveLocations)
   at Microsoft.CodeAnalysis.CommonReferenceManager`2.ResolveMetadataReferences(TCompilation compilation, Dictionary`2 assemblyReferencesBySimpleName, ImmutableArray`1& references, IDictionary`2& boundReferenceDirectiveMap, ImmutableArray`1& boundReferenceDirectives, ImmutableArray`1& assemblies, ImmutableArray`1& modules, DiagnosticBag diagnostic
s)
   at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.ReferenceManager.CreateAndSetSourceAssemblyFullBind(CSharpCompilation compilation)
   at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.ReferenceManager.CreateSourceAssemblyForCompilation(CSharpCompilation compilation)
   at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.get_SourceModule()
   at Microsoft.CodeAnalysis.CSharp.Symbols.SimpleProgramNamedTypeSymbol.GetSimpleProgramNamedTypeSymbol(CSharpCompilation compilation)
   at Microsoft.CodeAnalysis.CSharp.Symbols.SimpleProgramNamedTypeSymbol.GetSimpleProgramEntryPoint(CSharpCompilation compilation)
   at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.GetEntryPointAndDiagnostics(CancellationToken cancellationToken)
   at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.GetEntryPoint(CancellationToken cancellationToken)
   at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.CommonGetEntryPoint(CancellationToken cancellationToken)
   at Microsoft.CodeAnalysis.Scripting.ScriptB
uilder.Build[T](Compilation compilation, DiagnosticBag diagnostics, Boolean emitDebugInformation, CancellationToken cancellationToken)
   at Microsoft.CodeAnalysis.Scripting.ScriptBuilder.CreateExecutor[T](ScriptCompiler compiler, Compilation compilation, Boolean emitDebugInformation, CancellationToken cancellationToken)
   at Microsoft.CodeAnalysis.Scripting.Script`1.GetExecutor(CancellationToken cancellationToken)
   at Microsoft.CodeAnalysis.Scripting.Script`1.RunAsync(Object globals, Func`2 catchException, CancellationToken cancellationToken)
   at Microsoft.CodeAnalysis.Scripting.Script`1.RunAsync(Object globals, CancellationToken cancellationToken)
   at CSharpRepl.Services.Roslyn.Scripting.ScriptRunner.EvaluateStringWithStateAsync(String text, ScriptState`1 state, InteractiveAssemblyLoader assemblyLoader, ScriptOptions scriptOptions, String[] args, CancellationToken cancellationToken)
\ScriptRunner.cs:line 116
   at CSharpRepl.Services.Roslyn.Scripting.ScriptRunner.RunCompilation(String text, String[] args, CancellationToken cancellationToken)

Missing highlighting

Version

last

What happened?

This valid C# expression is missing highlighting for File:
image

Interestingly writing . after the second argument brings the highlighting back (although it's not valid afterward):
image

Referencing dll in csx file

So i have built a dll using net5 that contains classes and stuff i needed. The question is how to reference it into my .csx file? I tried this:
#r "../xu-cell-pos.Server/bin/Debug/net5.0/xu-cell-pos.Server.dll"
But it gave me an error:
(3,1): error CS0006: Metadata file '../xu-cell-pos.Server/bin/Debug/net5.0/xu-cell-pos.Server.dll' could not be found
I made sure the relative file path are correct. Also this works on dotnet-script. Thanks.

Windows 7 SP1 - Fail when trying to execute

Version

0.3.3

What happened?

When I try to run charprepl I got:

Unhandled exception. System.InvalidOperationException: failed to set output console mode, error code: 87
at PrettyPrompt.Consoles.SystemConsole.InitVirtualTerminalProcessing()
at PrettyPrompt.Prompt..ctor(String persistentHistoryFilepath, PromptCallbacks callbacks, IConsole console)
at CSharpRepl.Program.Main(String[] args) in C:\Users\will.fuqua\source\repos\CSharpRepl\CSharpRepl\Program.cs:line 38
at CSharpRepl.Program.

(String[] args)

[Feature Request] Add project context as reference

Hello, first of all, I hope this issue isn't too confusing.

Sometimes I'm working on C# projects where I'd like to use this C# repl on, but that would mean that I'd have to manually reference the right shared framework, nuget dependencies and other project references.

To fix that, I'm basically proposing adding a console option where one or multiple csproj files could be passed and CSharpRepl would resolve the references and everything necessary.

Since MSBuild is a pain, I recommend using https://github.com/daveaglick/Buildalyzer as it lets you get all the required information for this.

NET 6 Preview Support

Feature Description

I recently reinstalled my vs installation and just noticed that it also removed my net5 installation. I think it would be good to support net6 preview versions too. Thanks.

It was not possible to find any compatible framework version
The framework 'Microsoft.NETCore.App', version '5.0.0' was not found.
  - The following frameworks were found:
      6.0.0-preview.6.21352.12 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]

You can resolve the problem by installing the specified framework and/or SDK.

The specified framework can be found at:
  - https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=5.0.0&arch=x64&rid=win10-x64

Allow visual dump of Objects

Feature Description

For a while now, I've been looking at free alternatives to LINQPad and CSharpRepl has always stood out to me for being something very flexible (along with frequent updates), and a thing that I noticed while using this tool recently is the lack of "visually" inspect any arbitrary object, similar to what LINQPad and SharpLab provide.

Below are some examples of what I'm talking about.

Example images

Dump Example 1
Dump Example 2

Obviously that there are certain things that probably cannot be accomplished inside a terminal, but anything is better than nothing.

Simplify tool name?

Feature Description

Since it came out, I have loved Visual Studio's CSharp Interactive tool and since I discovered that I could run it outside of it I always had csi.exe in the system environment variables
I confess that csharprepl has won it by a lot, because it has managed to have the intellisense that it lacked outside of Visual Studio. Thanks @waf !!

This is not a feature or a bug report per se, it is more of a discussion.

I am not an English speaker and I confess that I almost always forget how to write csharprepl. I compare it with how I ran CSharp Interactive: Win+R -> csi -> ENTER. With only 6 keystrokes I achieved what I wanted, csharprepl by itself is more than 6 keystrokes, which I almost always misspell, so I end up using csi 😫.

Is it possible, at this initial stage of the tool, to change or shorten its name? put a default alias? I've been looking around and I think the dotnet tools don't allow aliases so I'm not very hopeful 😥

Maybe it's just me, so feel free to ignore and close this issue without any problem.
Meanwhile if someone is in the same situation as me, I share my solution:

Using cmd:

  • Create a csi.cmd file in a folder which path is in the PATH environment variable
  • Write start cmd /K csharprepl and save
  • To start csharprepl just: Win+R -> csi -> ENTER

Using Windows Terminal

  • Create a csi.cmd file in a folder which path is in the PATH environment variable
  • Write wt -w 0 nt csharprepl and save
  • To start csharprepl just: Win+R -> csi -> ENTER

"Package contains multiple .nuspec files" when referencing nuget packages on linux

Version

0.3.5

What happened?

I am trying to reference nuget packages on linux but often get errors like "Package contains multiple .nuspec files" or sometimes it seems to work but doesn't end up in adding references, like for "Microsoft.EntityFrameworkCore.SQLite".
As an example, if I run csharprepl and try to install "Microsoft.EntityFrameworkCore" it goes fine, then "Microsoft.CodeAnalysis.CSharp.Scripting" fails with the above error. I then have to completely remove cache to proceed. Also restarting csharprepl and trying to reference Microsoft.EntityFrameworkCore that worked before suddenly doesn't and displays the above error.

Create a CHANGELOG.md

Feature Description

Create a CHANGELOG.md file to easily know what the new features and bug fixes are in each new release (also you can use github releases)

Crash when theme file does not exist

Version

last

What happened?

If a non-existing file is specified as a theme argument, CSharpRepl crashes:
image

It should output a nicer error and use the default theme.

CSharpRepl is picking incorrect platform while referencing nuget

Version

0.3.5

What happened?

Using System.Management nuget throws

System.PlatformNotSupportedException: System.Management currently is only supported for Windows desktop applications.
   at System.Management.ManagementOptions..ctor()
   at System.Management.ConnectionOptions..ctor()
   at CsiUtils.UserCredentials.GetSelf()

E.g. this code

new System.Management.ConnectionOptions();

works while running from console app, but throws if run from CSharpRepl.

System.Management is implemented only for Windows. There are two base versions:
.nuget\packages\system.management\6.0.0\lib\net6.0 (everything throw PlatformNotSupportedException)
.nuget\packages\system.management\6.0.0\runtimes\win\lib\net6.0 (actual win implementation)

I've located loaded assembly after

#r "nuget: System.Management"

in temp directory where referenced copy is and it definitely is wrong implementation (=same size as in .nuget\packages\system.management\6.0.0\lib\net6.0).

Roslyn's word span detection

Feature Description

Use CompletionService.GetDefaultCompletionListSpan for PromptCallbacks.GetSpanToReplaceByCompletionkAsync.

Unable to load projects "#r ...csproj"

Version

C# REPL 0.3.0

What happened?

When running on Mac OS, including a project simply shows a 'no such file or directory' error

> #r "./Model/Model.csproj"
Building ./Model/Model.csproj
No such file or directory

In bash

> which dotnet
/usr/local/share/dotnet/dotnet

Commit completion item by '(', '<', '+', ...

Version

last

What happened?

This is quite complex for C# to get right so I would probably remove configurability of this keybinding (via --commitCompletionKeys) and extend current defaults accordingly.

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.