all features work but the "print" function doesn't show the output in a bubble, but only with a β mark to the right. I am using an anaconda python. It this a problem of anaconda?
I can't reproduce this. Could you try to run Hydrogen again and open the dev console (shift-ctrl-i) and post a screenshot of the output.
today when I tried again, the problem disappeared, I don't know why, but it suddenly works. Thank you for your reply, fantastic package!
@lgeiger, i have a similar problem, except that i don't even see a check mark. nevertheless, as in (#88), i can connect to the jupyter kernel outside of hydrogen and check for example that a variable was instantiated and the code properly executed, or add a watch which will function as expected.
Here is the result of apm -von a mac running OS X 10.11.6:
apm 1.9.2
npm 2.13.3
node 0.10.40
python 2.7.12
git 2.9.2
Executing a "Run and Move Down" on print("hello") gives me the following output in the console:

I hope i'm not missing something obvious. Tell me if i can provide more useful information, I hope to be able to use this exciting package soon!
@pierregodard Which hydrogen version are you using? We fixed an issue with "Run and Move Down" in the latest release.
Is just "Hydrogen: Run" working for you?
thank you for your answer Lukas. i use Hydrogen 0.11.0 and unfortunately "Hydrogen: Run" doesn't work either.
This is very strange. I have pretty much the same setup and no problems.
And what Atom version?
my Atom version is 1.8.0
I've tested Atom 1.8.0 and 1.9.0, and I can't reproduce it.
I've tried the UI themes One Light and Atom Light.
Which UI theme are you using?
i use One Light (with Base 16 Tomorrow Light) but same effect with One Dark (and Solarized Dark)
The most intriguing thing is that the log in the screenshot looks perfectly normal.
Could you run in the console the code document.getElementsByClassName('bubble-result-container').length? In my computer, this command returns 2 (one element in the editor pane and another in the watch pane).
this returns 1 as is, but if i add a watch then it returns 2
(i've also tried to disable all community packages except for hydrogen, without success. i feel like i must be missing something pretty major!)
Does the watch panel work?
I mean when you type print("hello") in the watch, and re-run Hydrogen: Run in the text pane, does the watch panel show the result?
Also, it'd help if you could post a screenshot of the console after running document.getElementsByClassName('bubble-result-container') and expanding the <div> elements it returns.
was just doing that ;) not sure what should be in there but it doesn't look there's anything like a "hello".

and yes the watch panel works:

In the previous screenshot, did you type a 2 in the watch panel? If so, the first div must be in the watch pane, and the empty one must be in the edit pane.
These are the unexpected results I've notice up to this point:
document.getElementsByClassName('bubble-result-container').length to be 2.ResultView: Rendering as <pre>βhelloβ</pre>β, but the div in the editor pane is empty.Please, could you repeat the same exercise (after restarting Atom and without the watch panel)?
But this time, please, run document.getElementsByClassName('bubble-output-container') and post the screenshot after expanding the divs.
thank you for all your help!
In the previous screenshot, did you type a 2 in the watch panel? If so, the first div must be in the watch pane, and the empty one must be in the edit pane.
oh i understand, i had been assigning a 2 to a variable to check if the kernel accessed outside of Hydrogen was taking that into account, so that must have persisted.
the watch panel is created on kernel startup (regardless of whether is visible or not). So, I'd expect document.getElementsByClassName('bubble-result-container').length to be 2.
i confirm that after relaunching Atom the result of this is 1 though, not 2
The console log reports
ResultView: Rendering as <pre>βhelloβ</pre>β, but thedivin the editor pane is empty.
yes that is confusing...
running document.getElementsByClassName('bubble-output-container') returns:

@pierregodard If you feel like debugging this further, I'd look at these lines.
The line that appends the result to the bubble-result-container is this line.
And things that could go wrong:
ok thank you for the pointers! that may be a long shot for me since my literacy with Atom and [coffee|java]script is close to null but i'll try. thank you again for all your help
@n-riesco apologies in advance for my rather limited abilities here but i'll try to provide some more information. if i add a breakpoint at container.appendChild htmlElement i'm able to look into the container and the beginning looks like this:

with mimeType being "text/plain". So apparently the "hello" text is in there.
Then i'm not sure why but the execution after line
if @errorContainer.getElementsByTagName('span').length is 0
jumps to something that looks like more related to communication with the kernel:

any advice on how to investigate further?
@pierregodard On the watch panel, if you click on div.bubble-result-container, you'll be shown the location of this div in the DOM. Could you post a screenhot?
At this point, we know that the result is appended to div.bubble-result-container. Now, we need to find out where div.bubble-result-container is. It should be a child of div.bubble-output-container in the editor pane. But from the fact that we don't see a result bubble and that document.getElementsByClassName('bubble-result-container').length is 1, we suspect there is none in the editor pane.
if i click on div.bubble-result-container i get:

but except for div.bubble-result-container being a child of div.bubble-output-container, itself a child of div.hydrogen.output-bubble, i don't see much happening which would support your guess that there is no bubble-result-container in the editor pane right?
It looks like div.bubble-output-container isn't attached to the DOM (which explains document.getElementsByClassName('bubble-result-container').length being 1).
This result is suggesting that the problem is somewhere in the code creating the output bubble. In particular these lines.
Could you check if this line gets ever run?
ok i'll look at this now.
in the meantime, here is the output of the console when i relaunch Atom and call Hydrogen: Run for the first time. It seems to me that it's the business of connecting to the Jupyter kernel but maybe you'll see something suspicious:

other screenshots i posted before correspond to a second call to Hydrogen: Run on the same line. i thought the first call was starting a kernel if none was running but maybe i should have mentioned that earlier.
view = @insertResultBubble row here gets executed once (if i make proper use of the debugger).
when i step over though, instead of going to the following line kernel.execute code, (result) -> it goes to that one : unless @watchSidebar? (which is maybe totally normal as i don't understand yet the @ syntax)
I've also noticed that erratic behaviour in the debugger (since Coffeescript is a transpiled language, I guess that it's hard for the debugger to know where to set a breakpoint) .
I thought the problem could've been caused by insertResultBubble not being called. Could you check that? For example, by setting a breakpoint here.
@markerBubbleMap[marker.id] = view is called once
I don't trust the debugger (I can see the same erratic behaviour you described here.
Would you be able to edit ~/.atom/packages/Hydrogen/lib/main.coffee and add a console.log 'insertResultBubble:', @markerBubbleMap above this line?
If you add this line, the console should output a line starting insertResultBubble: and listing all the output bubbles.
On second thoughts, let's try something more straight forward. If you're able to edit ~/.atom/packages/Hydrogen/lib/main.coffee, could you remove these lines and see if this fixes the problem?
for your second to last suggestion, not sure it's the right workflow (i don't know if i'm supposed to instead call apm develop hydrogen etc. to do things in a clean way), but i just edited the file directly and from console.log 'insertResultBubble:', @markerBubbleMap i got an empty list in the console:
insertResultBubble: Object {}
will try your last suggestion now.
commented out the three lines, reloaded Atom, but it doesn't change the behavior.
[i also commented out the code responsible for writing ResultView: Rendering as MIME text/plain in the console to actually check that my editing was actually taken into account (and it was).]
On 23/07/16 11:08, pierregodard wrote:
for your second to last suggestion, not sure it's the right workflow (i don't know if i'm supposed to instead call |apm develop hydrogen| etc. to do things in a clean way), but i just edited the file directly and from |console.log 'insertResultBubble:', @markerBubbleMap| i got an empty list in the console:
|insertResultBubble: Object {}|
will try your last suggestion now.
Oops! I should've said to add console.log 'insertResultBubble:', @markerBubbleMap below @markerBubbleMap[marker.id] = view?
On 23/07/16 11:18, pierregodard wrote:
commented out the three lines, reloaded Atom, but it doesn't change the behavior.
This is baffling. To sum up, we've confirmed that:
div.bubble-output-container is not in the DOMinsertBubbleResult being invokedhere is (a part of) the output when console.log 'insertResultBubble:', @markerBubbleMap is inserted below @markerBubbleMap[marker.id] = view. Not sure what would be the best way to give you the whole thing.

This is baffling. To sum up, we've confirmed that:
div.bubble-output-containeris not in the DOM- despite
insertBubbleResultbeing invoked
that seems correct from my end. (just growing a bit of anxiety that i might miss something very obvious and waste your time)
Your last screenshot is giving us an important clue. If this line had worked as expected, then ResultView.element in the console log should've been div.hydrogen.output-bubble.atom--block-decoration-59, but instead it is missing the atom--block-decoration-* class.
You said above that you're using Atom 1.8.0. How did you install it? Did you build from source? Or you used the installer at https://atom.io/ ?
i used the installer from https://atom.io/
should i try building it from source?
@pierregodard I don't want to waste your time. If this issue is urgent to you, then, yes go for it and build form source. Otherwise, I will go through the commits in the Atom repository and see if anything is changed in the code for block decorations (I'm not going to do this today, though).
@n-riesco after building Atom 1.10.0-dev-3a4e251 the behavior is unfortunately the same :(
looks like the decoration is still absent on my end:

i'm happy to continue to try to provide more information on this, but this is certainly not an urgent issue for me. thank you very much for already getting that far with me.
I've tested Atom 1.10.0-dev-3a4e251 and again I can't reproduce this issue.
What Atom packages have you got installed?
i have several community packages although i already tried disabling all of them except hydrogen and it didn't change the behavior. Should i try _removing_ the community packages? (although i hope this wouldn't erase my packages' settings)
here is the list from apm list:
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
On 23/07/16 13:55, pierregodard wrote:
Should i try /removing/ the community packages? (although i hope this wouldn't erase my packages' settings)
Since I'm not using most of those packages, it'll be easier for me to install them one by one.
(could they have an influence even when they are disabled though?)
No luck! I'm unable to reproduce this issue with any of those packages.
thank you for trying this. i'm a bit at loss on how to continue the investigation as i know very little about how packages work in Atom, let alone my also very limited knowledge of the kind of technologies used here.
On 23/07/16 16:06, pierregodard wrote:
thank you for trying this. i'm a bit at loss on how to continue the investigation as i know very little about how packages work in Atom, let alone my also very limited knowledge of the kind of technologies used here.
On my side, I want to have a look at Atom's code for block decorations and see where things could go wrong.
On your side, I'd try to rule out a configuration problem:
~/.atom/config.csonok, some news here! i installed Atom on a guest user account, then just installed hydrogen and it.......works! (and it's very nice!:)
so definitely a configuration problem on my end. since it's not the packages, it must be some init file. apologies in advance if it's been a stupid configuration issue i should have been able to isolate much earlier. will follow up asap.
Glad to hear at least it's working on a clean install.
It'd be good to know which setting is causing this issue.
Could you have a look at ~/.atom/config.cson in your user (the one that sees this isssue)?
There'll be settings for all your packages. I'm not going to ask you to go through them, but could you have a look at the core and editor keys and see if anything catches your eye? Mine is pretty basic:
core: {}
editor:
invisibles: {}
showIndentGuide: true
showInvisibles: true
the editor part for me read:
editor:
fontFamily: "Source Code Pro"
fontSize: 13
invisibles: {}
scrollPastEnd: true
softWrap: true
useShadowDOM: false
zoomFontWhenCtrlScrolling: true
the faulty line is useShadowDOM: false. Removing it solves the problem!! :-))
i have absolutely no idea how it got there, it doesn't seem like an accessible option from the settings page (EDIT: it actually _is_ an option at the bottom of the settings page). I'd like to understand how it got there, but in any case, THANK YOU for bearing with me!
@pierregodard If you feel like contributing, you could update our https://github.com/nteract/hydrogen/blob/master/TROUBLESHOOTING.md with a new entry advising users against disabling Use Shadow DOM under Settings > Editor
will gladly do that. just a very stupid question: the simplest (only?) way to do that is to fork your repo and submit a pull request right?
The simplest way is to edit the file directly on github. Go to https://github.com/nteract/hydrogen/blob/master/TROUBLESHOOTING.md and click on the icon pencil.
just did that, thank you.
I've opened an issue on Atom's repository. I'm closing the issue here.
Thank you both for debugging this π
Most helpful comment
the editor part for me read:
the faulty line is
useShadowDOM: false. Removing it solves the problem!! :-))i have absolutely no idea how it got there, it doesn't seem like an accessible option from the
settingspage (EDIT: it actually _is_ an option at the bottom of thesettingspage). I'd like to understand how it got there, but in any case, THANK YOU for bearing with me!