Comments (15)
I would dearly love to have this feature. So much so that I'd been looking at what might be necessary to implement it.
In Hydrogen, the code to select the current cell is (https://github.com/nteract/hydrogen/blob/d850f50df78e20ff7d5918884155bb67bfa02cde/lib/code-manager.coffee):
getCurrentCell: ->
buffer = @editor.getBuffer()
start = buffer.getFirstPosition()
end = buffer.getEndPosition()
regexString = @getRegexString @editor
unless regexString?
return [start, end]
regex = new RegExp regexString
cursor = @editor.getCursorBufferPosition()
while cursor.row < end.row and @isComment cursor
cursor.row += 1
cursor.column = 0
if cursor.row > 0
buffer.backwardsScanInRange regex, [start, cursor], ({range}) ->
start = range.start
buffer.scanInRange regex, [cursor, end], ({range}) ->
end = range.start
console.log 'CellManager: Cell [start, end]:', [start, end],
'cursor:', cursor
return [start, end]
The Regex just checks if this is a "cell delimiter line" so I'm sure it would be easy to substitute in a regex for "##" until something else emerges.
Then in terms of atom-juno-client, it seems like you'd just need to either update the blocks.coffee code (https://github.com/JunoLab/atom-julia-client/blob/master/lib/misc/blocks.coffee) to add something about the cell...
Or maybe write a cells.coffee set of code with a 'get' function.
Finally, then you'd need to add something to evaluation.coffee (https://github.com/JunoLab/atom-julia-client/blob/master/lib/runtime/evaluation.coffee) to use the cell instead of the block.
I have zero free time, and have never done anything with coffee, etc. but I might be able to defer more important work to do this :)
from atom-julia-client.
I picked up from @dgleich's comment above, and got an initial version of this working. I don't really have time to make this better, and don't think it's quite ready for merging, but the commit is here if someone wants to run with it: JobJob@f2bff9b
It just adds one command: julia-client:run-cell
. You separate cells with #---
(delimiter is set here) and it will run the code in the cell the cursor is currently in.
Edit: found a little time to also add run-cell-and-move
and decided to make a PR, latest version of code in PR linked below.
from atom-julia-client.
Sure, makes sense.
from atom-julia-client.
👍
Not sure what syntax would be better, but I kinda like ##
since it's close to matlab and could be interpreted as markdown as well -- you jsut take a h2
and structure your code with that.
from atom-julia-client.
Let me add that displaying the results of each cell inline, right before the next cell division, would be awesome and would make Atom work more like a notebook. I guess that is harder from a technical perspective though.
from atom-julia-client.
I like the idea of cells, good suggestion.
But I also don't want my editor to become a notebook so I don't know that I'm on board with holding all results to the bottom of each cell. Given that we don't have a harsh of a visual break between cells (like the notebook does) I think it would be confusing to collect results at cell breaks
from atom-julia-client.
Yeah, I think I'd prefer the results to stay inline, i.e. have the cell-evaluation work like manually evaling all lines in the cell instead of working like the eval file
command.
from atom-julia-client.
Maybe a compromise would be to have cell Eval when evaluating the cell division line, and line eval for all other lines?
from atom-julia-client.
I think that another keybindings for cell eval is fine to distinguish
between line and cell eval. The discussion above was about where cell eval
output should go.
// Spencer
On Nov 5, 2015 7:11 PM, "Nils" [email protected] wrote:
Maybe a compromise would be to have cell Eval when evaluating the cell
division line, and line eval for all other lines?—
Reply to this email directly or view it on GitHub
#63 (comment)
.
from atom-julia-client.
Once atom/atom#9930 lands, we could easily implement @cdsousa's suggestion (along with a setting to switch to sequential inline evaluation of all lines in the cell).
from atom-julia-client.
atom/atom#9930 has been merged
from atom-julia-client.
Would this be a good time to revive this?
from atom-julia-client.
I've just noticed that Hydrogen now supports this (just search for "cell" in the page).
It uses a syntax I'm not a big fan, but maybe if this gets implemented here it would be good to be compatible.
from atom-julia-client.
Just wanted to add some kudos here! This is great to have!
from atom-julia-client.
Should this be closed now?
from atom-julia-client.
Related Issues (20)
- julia-client HOT 2
- Uncaught TypeError: log is not a function
- Uncaught TypeError: log is not a function HOT 1
- Uncaught TypeError: path.dirname is not a function
- Uncaught TypeError: log is not a function
- Uncaught TypeError: Cannot read property 'on' of undefined HOT 1
- julia-client 0.12.6 under Windows: Cannot resolve directory path of julia.exe
- Uncaught TypeError: log is not a function
- Uncaught TypeError: shell.openItem is not a function
- node-pty-prebuilt needs a bump to 0.10 HOT 3
- Uncaught TypeError: Cannot read property 'dirname' of null
- Uncaught Error: Cannot find module '../runtime'Require stack:- $ATOM_HOME/packages\julia-client...
- Uncaught TypeError: log is not a function
- Uncaught TypeError: log is not a function HOT 2
- Uncaught TypeError: log is not a function
- Installing “[email protected]” failed HOT 8
- Error to start Julia in Atom with Julia Client package installed
- julia-client package HOT 3
- Not able to install
- MS Store Juliaup installer - "Couldn't resolve version." error. (Atom julia-client)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from atom-julia-client.