GithubHelp home page GithubHelp logo

ermau / instant Goto Github PK

View Code? Open in Web Editor NEW
108.0 108.0 10.0 3.69 MB

Research into instant feedback in software engineering

Home Page: http://ermau.com/instant-0-1/

License: Apache License 2.0

C# 100.00%

instant's People

Contributors

ermau 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

instant's Issues

Enable multiple methods

Once the initial method is enabled with the test code, you should be able to turn on display for methods other than the first enabled. This will require #32.

Move Instant button

It either needs to be moved to the end of the first line, or as a quick-fix style popup.

Object snapshots

Currently, object values are simply strings generated by [DebuggerDisplay] and/or .ToString(); We need to be able to take a snapshot of the object's state if we ever want to be able to move closer to debugger-like functionality.

We could:

  1. Create a deep copy of the object (hard, slow, complete)
  2. Track external property changes differently, associating it with the object (easy, faster, far from complete)

This would probably be an optional feature, given potential performance implications.

Switching loop iterations removes other visuals

This is likely due the fact that loops only try to re-display its own contents, which is messing with the ViewCache's internal count. It's re-purposing in-use displays, because it no longer sees them as in-use.

Inserting new code above existing code temporarily shifts adorners

int x = 5;  [x | 5]
int y = 2   [x | 5]
int x = 5;

Once you add the = 2, Roslyn sees the line as a 'valid' variable declarator, despite the lack of semicolon. Since it won't actually compile, it won't get executed and therefore there's a disparity between current and last executed operation IDs.

Cache execution of statements

Cache external method call results in order to allow instant feedback for code that interacts with long running methods (expensive calculations, database interactions).

Also, allow users to optionally wait for these external calls to finish once (and be cached) if they initially time out.

Method call selector

For situations where there are multiple calls to a method (multiple calls in test code, recursion, etc), there needs to be a way to view and select which call to view from multiple calls.

Disappearing adorners

Occasionally, inserting new lines will remove the adorners below the new line and they will not reappear.

Require detection

Dependency graphing for active file, avoid compiling non-needed files.

Infinite loop detected false positive for self assignment

Infinite loop detection throws

System.OperationCanceledException: Infinite loop detected
at LiveCSharp.StringObjectLogger.EndInsideLoop() in D:\Instant\Prototype\StringObjectLogger.cs:line 68

when self assignment is performed within a loop construct (for or while).

public int DoIt(){
    var n = 0;
    for(var i = 0; i < 5; ++i){
        i=i;
    }   
    return n;
}

DoIt();

Show exceptions inline

Instead of using the status bar, we should show exceptions inline just like any other visualization. Once #21 is done we can let them inspect the exception just like any other variable.

Load multiple files

Load multiple files into a script engine without failing. Current version of Roslyn does not support namespaces, so this will have to be worked around.

Multiple variable assignments throws off loop display

Multiple assignments to the same variable does not provide any spacing to match up with each iteration.

For example:

void Foo()
{
    for (int i = 0; i < 2; ++i)
    {
        int x = 6;
        x = 7;
    }
}

Foo();

Shows

| i     | x     | 
| 0     | 6     | 
| 1     | 7     | 
| 2     | 6     | 
|       | 7     | 

When it should show:

| i     | x     | 
| 0     | 6     | 
|       | 7     | 
| 1     | 6     | 
|       | 7     | 
| 2     |       |

Truncate strings

Given that the output is really just strings right now, we need a way to truncate them for long strings, arrays, etc. Truncate at a certain point, and provide a button to pop open a window with the full contents.

Overflow Exception while editing running code after changing loop counter

I made VS2012 crash by editing code containing a loop while Instant is running. The stack trace from the ActivityLog.xml file:

System.OverflowException: Arithmetic operation resulted in an overflow. at Instant.VisualStudio.ViewCache.ClearViews() at Instant.VisualStudio.InstantVisualStudio.AdornCode(ITextSnapshot snapshot, String code, IDictionary2 methods, CancellationToken cancelToken) at Instant.VisualStudio.InstantVisualStudio.AdornCode(ITextSnapshot snapshot, CancellationToken token) at Instant.VisualStudio.InstantVisualStudio.OnLayoutChanged(Object sender, TextViewLayoutChangedEventArgs e) at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.RaiseEvent[TArgs](Object sender, EventHandler1 eventHandlers, TArgs args)

Steps to reproduce:

  1. Create this test method:
        public void TestMe(string text, int max)
        {
            // What is it to begin with?
            text = text;
            max = max;

            for (int i = 1; i < max; i++)
            {
                var cropped = text.Substring(0, i);
                if (cropped.Contains(' '))
                {
                    var lastSpace = cropped.LastIndexOf(' ');
                    cropped = cropped.Substring(0, lastSpace);
                };
                cropped += "...";
            }
        }
  1. Click to run Instant next to the method name
  2. Enter in the box : TestMe("Lorem ipsum sefsoe ubsofu beofusbeo fusbe ofusbeof usboef", 20);
    and click OK, Should see the variables pop up.
  3. Click left and right next to the for loop counter. Note that the visualisation of code outside the for loop is lost (a different issue)
  4. After the last "cropped" line, insert a new line and try to type "cropped += "test" " , the editor should crash. Note that it only happens if you have manipulated the loop counter first.

My environment is VS2012 premium RTM, .NET 4.5 RTM.

Regards
Andy

Help in the popup box after clicking Instant

It took me a while to work out what had to be put in the box.

Could you pre-fill the box with the method signature so all the user has to do is fill in the parameters (if any)? Or a line of text explaining what needs to be typed in there.

Add diagnostic checks

Add checks against diagnostics before tracking methods, attempting to execute, etc.

Port to NRefactory

Due to the current license of Roslyn and it's closed source nature, the source needs to be ported to a system we can redistribute and ensure works on Mono.

private/internal methods inaccessible

Now that we're just compiling full code, including for the test code, private, protected and internal methods are no longer callable. Need to devise a way to call these.

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.