lukebuehler / cshell Goto Github PK
View Code? Open in Web Editor NEWA simple, yet powerful, C# scripting IDE and REPL
Home Page: http://cshell.net
License: Other
A simple, yet powerful, C# scripting IDE and REPL
Home Page: http://cshell.net
License: Other
If a DLL file reference is added in the workspace, add the ability to recompile the DLL via visual studio while the object is still referenced by CShell
In order to gain new functionality after recompiliation possibly provide a dialog that notifies the user a reference has been updated and ask to reload.
Also add the ability to easily reload the REPL window from the C# interactive UI.
Perhaps a .ResetWorkspace could be on the shell in addition to the OpenWorkspace() and CloseWorkspace()
ScriptCS script packs only work partially right now. We should add support for following:
Require<T>
is executed immediately support proper code completionHi Luke,
I am attempting to add a new reference to the ICompletion
provider via
editor.CompletionEngine.AddReferences(new Assembly[]
{
typeof(MathNet.Numerics.LinearAlgebra.Matrix<double>).Assembly
});
where the editor.ComletionEngine
is
ICompletion CompletionEngine;
This does not seem to add the required intellisense types to the completion list. Am I missing something simple here?
Right now the way the work space is organized is by having a .cshell file as root. From there we find out what our root folder is and display that.
It would be nice to make this even more simple, more like ScriptCS:
#r "c:\my.dll"
). This will also play nice with NuGet integration.Came up here: #1
Hi!
CSHell looks awesome but I would love to see it as an extension of the VS-Debugger because lambda expression is not supported there.
Would that be possible?
Cheers
Whenever I write list.Where(item
.. the code completion tries to insert a value instead of a parameter.
I think this would make a great package for Chocolatey.
Any chance to support awaiting for tasks?
Now to Roslyn is open source feels more ready for prime time, I want to switch the execution engine from Mono.CSharp to Roslyn.
I tried to edit the CShell.exe.config to include a console logger for my classes but that didn't work for whatever reason. It would be even better if the output could be directed to the output window. Is this possible?
If a user does not have permission within one of the directories within the Workspace root folder then it throws an unauthorizedaccessexception.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileSystemEnumerableIterator1.CommonInit() at System.IO.FileSystemEnumerableIterator
1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler`1 resultHandler, Boolean checkHost)
at System.IO.DirectoryInfo.InternalGetDirectories(String searchPattern, SearchOption searchOption)
at CShell.Modules.Workspace.ViewModels.FolderViewModel.LoadChildren() in c:\n\CShell\Src\CShell\Modules\Workspace\ViewModels\FolderViewModel.cs:line 84
at CShell.Modules.Workspace.ViewModels.FolderViewModel.get_Children() in c:\n\CShell\Src\CShell\Modules\Workspace\ViewModels\FolderViewModel.cs:line 74
Please put in Readme, right at th beginning, the minimum OS features required for the program
I keep wanting to hit F5 to run instead of Alt+Shift+Return. I'd like to see the hotkeys mimic those of Visual Studio. I suppose the ultimate solution is configurable hotkeys, with switchable schemes and one of them being Visual Studio style.
Currently the REPL will just grow infinitely until :clear
is called. If there's a lot of console output this can affect the performance of the REPL a lot. It seems anything over a few thousand lines gets hard to handle for AvalonEdit.
I noticed that in the REPL, the home key behaves like the end key.
In CSRepl.xaml.cs, this code explicitly does this.
if(key == Key.Home || key == Key.End)
{
MoveCaretToEnd();
keyEventArgs.Handled = true;
return;
}
So it appears to be intentional. But I think it's a standard behavior that the home key moves to the beginning of the line. Indeed, in Scratchpad, this is the behavior.
What's the reasoning behind this?
Hi I've downloaded the binaries on OSX but running mono Cshell.exe
results in The entry point method could not be loaded
Any plan to get this working cross platform?
Avalon edit uses a slightly different font than VS, we should use the same as visual studio.
Right now, if a package is missing the workspace fails to open, the references have to be cleaned out manually in the packages file.
ScriptCS is way ahead of CShell with many scripting possibilities and it supports many of the same things CShell tries to achieve. CShell could use the ScriptCS as the execution layer and then CShell development could focus on providing a rich UI.
Benefits would be:
-Leverage the fast paced development of ScriptCS
-Use their polished assembly management, from NuGet to local bin
-Switch between Roslyn & Mono compiler.
Highlight the opening parentheses when at the closing one and vice versa.
Currently dumping to the sink requires an URI address to know where to route the output to. This might be truly the best solution, but the current helper methods to dump results is not very user friendly.
new []{1.0,1.5,1.8,3.6}.Plot().AsBarPlot().ColorGreen();
Hi,
I was trying to test a regex parser and was wondering why I can not execute the following script:
// C# Script
// Press Alt+Enter to evaluate a single line or selection
// Press Alt+Shift+Enter to evaluate the whole script
static class myTest {
public static void testregex(string myString) {
var methodCall = myString;
var methodName = "";
var paramString = "";
Regex r = new Regex(@"([\w]*)\(([\w\,\""\s]*)\)");
Match m = r.Match(methodCall);
if (m.Success) {
methodName = m.Groups[1].Value;
paramString = m.Groups[2].Value;
string[] paramList = paramString.Split(',');
Console.WriteLine("methodName: {0}", methodName);
Console.WriteLine("paramString: {0}", paramString);
foreach (string myParam in paramList) {
Console.WriteLine(myParam);
}
} else {
Console.WriteLine("regex failed...");
}
}
}
Then call
myTest.testregex("MyMethod(\"call\",23)");
In order to get this working I have to select and run the class, and then select and run the method call separately. Is there a way to run this script all at once?
I get the error:
Evaluating external code (Scratchpad.csx): error CS1525: Unexpected symbol myTest' (2,14): error CS0101: The namespace
global::' already contains a definition for `myTest'
Thanks.
using ClassLibrary1;
var c = new Class1();
c.SomeMethod();
[Evaluating external code (Scratchpad.csx)]
(7,0): error CS1525: Unexpected symbol `var'
I looked around the site, wiki, and Tutorial.csx and couldn't find any guidance on using external libraries, so if I'm doing something wrong one way to resolve this issue would be to add some doco to that affect. :)
REPL editor HOME and END keys not working (version 0.1.1.20912)
HOME should go to begin of editing line
END should go to end of editing line
as we are with 'hands' in this stuff:
ESC should clear the edition line
F2 for a list of all commands (history), ENTER put select in edit line
F3 open a dialog box to FIND a string (regex) in all the text
CTRL+HOME/CTRL+END should go to begin/end of text (all text in c# interactive window)
PGUP/PGDN should up/down 1 page
Great product... thanks...
ZEE
Here is an example of an error generated by running code with total of 69 lines. Note how the error message is indicating line 170 as error location.
System.ArgumentOutOfRangeException: StartIndex cannot be less than zero.
Parameter name: startIndex
at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy)
at .Host(Object& $retval)
at Mono.CSharp.Evaluator.Evaluate(String input, Object& result, Boolean& result_set)
at CShell.ScriptingEngine.Evaluate(String input, String sourceFile) in c:\Users\Luke\Dev\GitHub\CShell\Src\CShellCore\ScriptingEngine.cs:line 170
some of the expected basic text editing functions don't appear to work, for example:
At the end of the line hitting the home key should take me to the start of the line, that does not in fact happen.
If i'm typing some code and I only wish to select the first portion of the text, typically I will cursor over then hit shift+home which selects to the start of the line. That is the expected behavior, what happens when I do this I get kicked to the end of the line.
This seems odd to me, if this is supposed to happen just let me know so I can adjust my work flow.
Thanks!
The evaluator static methods are not included as possible autocompletions.
For example if I type hel
at the REPL prompt the autocompletion window does not include the help
evaluator static method as a completion.
I think it would be advantageous to write unit tests around the particularly complicated sections of code. I don't see this as a solvable issue, but more of an ongoing task. Without tests it's easy for the code base to regress in a non-obvious way, which could be a problem considering the complexity of the project.
When I instantiate a class or a method (using an alpha) within a Shell.TryEvaluateFile(@"testscript.cs") command in OnOpened(), then the objects are available for intellisense in c# Interactive, but not in the code editor.
Hi!
Great tool! I have a problem though...
I paste this in the window:
List<string> strings = new List<string>();
strings.Add("Good");
strings.Add("Morning")
strings.Add("Starshine");
strings.Add("The");
strings.Add("Earth");
strings.Add("says");
strings.Add("hello");
strings.Where(s => s.Length == 5);
and when I hit Alt+Shift+Enter I get:
(4,0): error CS1525: Unexpected symbol
strings'`
When I move to each line and hit Alt+Enter everything executes well...:
[Evaluating external code (Scratchpad.csx)]
[Evaluating external code (Scratchpad.csx)]
[Evaluating external code (Scratchpad.csx)]
[Evaluating external code (Scratchpad.csx)]
[Evaluating external code (Scratchpad.csx)]
[Evaluating external code (Scratchpad.csx)]
[Evaluating external code (Scratchpad.csx)]
[Evaluating external code (Scratchpad.csx)]
[Evaluating external code (Scratchpad.csx)]
{Earth, hello}
so it must be some kind of bug... can you please check?
thank you!
david
Is dynamic not supported? I just tried this but am getting an error.
using System.Dynamic;
dynamic source = new ExpandoObject();
source.Property1 = "test";
Console.WriteLine(source.Property1);
(2,0): error CS1525: Unexpected symbol `dynamic'
Currently references can be added from GAC and file.
Would it be possible to extend CShell with the ability to download and add a NuGet package as reference?
It seems like the autocompletion doesn't currently work very well when defining new classes/methods/etc. right now, and because of that often completes something unexpected.
If I open a new script file and type public static[spacebar]
in it the static
gets autocompleted to ContextStaticAttribute
. This is unfortunate because I do actually want to static
because I'm creating a class but it doesn't seem to even consider static
as a possible completion.
Since switching to ScriptCS variables are not really supported anymore in the REPL a lot of completion functionality is lost.
As talked about here #15
version 0.1.2 targeting .net 4.5 excludes Windows 2003/XP and previous
Please re-target to .net 4.0, at least until MS decides to launch a .net runtime 4.5 to these OS...
or maybe someone come with a fix/package to allow this...
maybe the "Evil Empire" in .net 5.0 contemplates at least NT5 again... ( ;-) )
One of the biggest issues I find using CShell along side my IDE is that autocompletion behaves significantly differently in CShell than in Visual Studio + Resharper. This means that I must keep the context in the back of my mind whenever I'm using CShell alongside VS + Resharper or I try to enter text that will autocomplete in Resharper but not in CShell. Then when I inevitably mess this up my mind gets thrown off the code I'm writing and I have to go back and fix it.
I wanted to open this issue and get your thoughts on it and learn about anything you have planned before writing up a complete proposal for a revised completion algorithm.
Should feature requests for auto-completion be filed here or at the Avalon Edit project?
A good example of something I like about the Resharper algorithm (and what throws me off when when using CShell) is that if I'm trying to match DateTime, in Resharper I can enter DT
, see that there are a lot of possible completions, and continue on to type DTime
which will filter these down to just a couple completions, one of which is DateTime, which is really nice when just the first letters of the words does not filter the list enough for my taste.
I'm willing to write up a more complete and algorithmic description of the Resharper behavior as I understand it if that would be helpful, but I wanted to make sure this was a plausible change first.
I really like CShell and am hoping to completely replace LINQPad with it. It really is a great project and I appreciate all the work you're putting into it.
Is it possible to remember assembly refrences so that they are restored when CShell workspace is opened again?
The workspace life cycle needs to be finished:
start.csx
and refereces.csx
when a workspace is opened.close.csx
This could be a configurable list in the global settings of script names that are executed. It would have reasonable defaults but the user could change this.
You can select text in the C# interactive window and drag it to another line, creating a mangled mess. Not HUGE deal but it should be readonly right?
When I escape quotation mark like this:
Console.WriteLine("<video width=/"640/" height=/"480/" controls>");
It does not recognize the escape slash before quotation mark and thows errors.
Hi, I really love your CS-Hell ๐
I missing a feature that would help a lot: reset the interactive shell.
reason: i do not want to re-open the app just for doing that.
A Shell.Repl.* function would be enough for the moment.
TY!!
Hi,
When create a System.Windows.Forms.Form object -> then invoking .Show() method, I can't continue using C# interactive afterward. CShell would stop responding as soon as I start to type in C# interactive.
Thank you for this valuable effort.
Kind regards,
Osama Al Shammari.
Something similar to what VS or LINQPad has.
With the new ReplExecutor the code is not evaluated asynchronously anymore, this functionality needs to be added back.
This is another example of an improvement inspired by my experience with Resharper as discussed in #25.
Currently if I have an autocompletion candidate SomeLongName
then sln
will match it because it matches the first letter of each word. If I have a candidate anotherLongName
however aln
will not match it because it's in camel case instead of pascal case.
Examples of names you might want to autocomplete that would be likely to be in camel case include variables and fields.
It would be great if autocompletion worked with camel case names as well as it does with pascal case names.
Custom modules are currently not supported anymore but they should be.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.