Git Product home page Git Product logo

cshell's People

Contributors

joelhoro avatar lakebranch avatar lukebuehler avatar medmondson avatar theelderwand avatar ttu 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  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

cshell's Issues

Have shell not hold reference to original files when adding an explicit file reference

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()

Support ScriptCS Script Packs

ScriptCS script packs only work partially right now. We should add support for following:

  • Load script packs when a new reference is added
  • If a Require<T> is executed immediately support proper code completion

Cannot Seem to Add Assembly to Intellisense

Hi 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?

Switch to a more simple work space: Folder is the work space, naming conventions

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:

  • The root of CShell is a directory.
  • The loaded libraries for that workspace are in a folder called lib or bin, to load external libraries we can create a simple text file containing a list of wanted libraries (Using Roslyn convenstion of #r "c:\my.dll"). This will also play nice with NuGet integration.
  • If there's a .cshell file present it is executed to customize the work space via code.
  • If there's a .layout file present it will restore the work space layout (open documents, sinks, and so on). When closing CShell the layout is always saved in a .layout file, this can be turned off in the global settings.

Part of the VS Debugger

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

Print NLog statements to output window

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?

UnauthorizedAccessException on trying to access directories within the workspace

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.FileSystemEnumerableIterator1..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

Visual Studio style hotkeys

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.

Make REPL lines buffered

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.

  • REPL should simply be buffered, after a few thousand lines the oldest ones get removed.
  • Remove line numbers in REPL.

Home key acts like end key

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?

Use Visual Studio font

Avalon edit uses a slightly different font than VS, we should use the same as visual studio.

Support NuGet package restore

Right now, if a package is missing the workspace fails to open, the references have to be cleaned out manually in the packages file.

  • On workspace open, missing references should be listed
  • There should be a restore command in the REPL
  • There should be a restore button in the package manager UI

Investigate how to use ScriptCS as the underlying execution engine

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.

Rethink the sink API, make it more fluent

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.

  • The result of a dump should return a fluent interface that allows the modification of the result: new []{1.0,1.5,1.8,3.6}.Plot().AsBarPlot().ColorGreen();
  • Management of active sinks should be better too. Setting the location in the shell, clearing them, closing them, etc.
  • The way sinks are added to CShell should be made more transparent and simple. How about adding sinks (and other CShell modules) using NuGet?

Problem with defining a class and then calling a method within that class.

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 namespaceglobal::' already contains a definition for `myTest'

Thanks.

Unable to use external libraries via 'using'

  1. Create simple external library (DLL)
  2. Add the lib as a reference to the CShell workspace
  3. Add a 'using ___' statement to Scratchpad.csx for the namespace of the lib
  4. Notice no commands following the 'using' statement execute correctly:
using ClassLibrary1;

var c = new Class1();
c.SomeMethod();
[Evaluating external code (Scratchpad.csx)]
(7,0): error CS1525: Unexpected symbol `var'

classlibrary1 dll

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. :)

Add REPL hot-keys

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

Line number shown in errors does not correspond to actual error location

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

Interactive Editor

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!

Unit tests

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.

Visibility of object instance for Intellisense

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.

"error CS1525: Unexpected symbol" on Run (Alt+Shift+Enter)

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

dynamic support

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'

Add reference from NuGet

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?

Autocompletion does not work very well when creating a class in a script

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.

Include variables in REPL code completion

Since switching to ScriptCS variables are not really supported anymore in the REPL a lot of completion functionality is lost.

  • Include all available variables in REPL code completion document. (How should this be done?
  • if a class definition is evaluated, it should be visible for the REPL as well.

version 0.1.2 targeting .net 4.5 excludes Windows 2003/XP and previous

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... ( ;-) )

Allow matching on partial words combined with camel case for autocompletion (Resharper style)

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.

Save references

Is it possible to remember assembly refrences so that they are restored when CShell workspace is opened again?

Complete workspace startup/shutdown lifecycle

The workspace life cycle needs to be finished:

  • Run certain scripts like start.csx and refereces.csx when a workspace is opened.
  • Run shutdown scripts when a workspace is closed like 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.

Escape quotation mark in Console.WriteLine

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.

Reset Interactive

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!!

Can't Invoke a Running Form

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.

Evaluate code async

With the new ReplExecutor the code is not evaluated asynchronously anymore, this functionality needs to be added back.

Match camelCase as well as PascalCase by first word letters when autocompleting

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.

Support CShell modules again

Custom modules are currently not supported anymore but they should be.

  • Load modules from general modules folder at startup
  • Make module assemblies available to workspace.
  • If they include ScriptCS extensions they should be supported too

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.