python - Extending PyDev editor in Eclipse with a side-by-side display for live coding like Bret Victor's demo -


I have written an Eclipse plug-in, because this adds a display column to the PDE editor. In that column, it shows how the variable values ​​change in the form of the code, including many columns of the loop or repeat function calls. The display is updated while editing the code.

My question is: How can I expand the Pydeev editor to add this extra column which opens with source code vertically, and horizontally scrolls horizontally to show several Column in long-running loop? My view is that when you compare two text files, you create a window that you get, but still allow the user to edit the python code and use the syntax highlighting of the PyDev editor. For now, I'm only displaying the text, but I also want to be able to display the graphics in this column.

To get the first release work, to create a sub-section of my current hack line number ruler, rather than line numbers with their own text, it's really ugly, especially the way I implement horizontal scrolling Have done

If someone is interested in merge the feature in PyDev team or is interested in exposing some expansion points to make it better, then I am happy to panic, request work and a bridge I need some guidance, though.

This idea came from Brett Victor, especially on section 17: 30-21: 30. If you want to see what I have done so far, then I have posted, as well.

Here is an example display for a binary search algorithm. (The display is on the right, the code is on the right side.)

  # echo width 40 n = 4 a = [1, 2, 4] Def search (n, a): less = 0 less = 0 high = 2 high = lane (a) - 1 While less & lt; = High: Middle = 1 | Middle = 2 middle = (low + high) / 2v = 2 | V = 4 v = a [middle] | | If n == v: | Return between 2 withdrawals | If n & lt; V: | High = mid-1 | Other: less = 2 | Low = middle + 1 return -1i = 2i = search (4, [1, 2, 4])    

After giving some useful hints from the Ingo and Fabio on the Pieve team, I have made some progress to make an extension for the main signal org.pythrough_dev_dev_pyedit_listener and < Register for the code> onCreatePartControl event, then the regular PyEdit control was helpful in learning how to create an extended interface.

Another challenge was synchronizing two scroll bars. It looks like you have to register for the onCreateSourceViewer event, and then you must register a view port listener.

I have posted a sample project to demonstrate the technique.

Comments