Closed LRydin closed 1 year ago
Nothing much we can do here - this should be fixed in Hydrogen package.
I'm not even sure what's supposed to be editor.languageMode, considering that the text editor never had this as a documented API...
Found the error - this condition is invalid as to get a version (parseFloat should not be used to get semantic versions or any version in general): https://github.com/nteract/hydrogen/blob/621cb9990705a19bc9f7d3d2f0d0819c23ce2295/lib/utils.tsx#L221
Please, ask for Hydrogen authors to fix this condition - we literally have nothing we can do in this situation, sorry...
Found the error - this condition is invalid as to get a version (parseFloat should not be used to get semantic versions or any version in general): https://github.com/nteract/hydrogen/blob/621cb9990705a19bc9f7d3d2f0d0819c23ce2295/lib/utils.tsx#L221
Please, ask for Hydrogen authors to fix this condition - we literally have nothing we can do in this situation, sorry...
If that's the case, then why does running code via Hydrogen work when executing via Packages -> Hydrogen -> Run from the Pulsar menu options?
Disclaimer: I have absolutely no idea how packages are constructed within Pulsar, which means it's entirely possible the Hydrogen team borked something with the code responsible for executing code via keyboard shortcuts, but not via the menu options.
@mauricioszabo:
If that's the case, then why does running code via Hydrogen work when executing via Packages -> Hydrogen -> Run from the Pulsar menu options?
This is exactly why I believe this is Pulsar-related and not Hydrogen related. How can it run with a right-click hydrogen:run
but not with shift-Enter on the editor? (thanks @shr00mie).
Folks, I don't know - maybe when running via the menu it doesn't detect the active text editor the same way, and uses a different path? For example, on these lines, it basically exits the process without calling the offending function if some conditions fails: https://github.com/nteract/hydrogen/blob/621cb9990705a19bc9f7d3d2f0d0819c23ce2295/lib/code-manager.ts#L132-L135
There's also another situation on the code where it bails of if the conditions are different, and they can be different because of different focus at the time, etc.
What I do know is that the Hydrogen code is not correct - there isn't a .languageMode
on text editors, and you can't parse versions with parseFloat
- and these are the issues we're seeing. Somebody that's interested could run inside Atom (an old version) and try to see in which conditions that error occurs.
Or, you can open your init script and "patch" atom.getVersion
to always return something that satisfies that version, like atom.getVersion = () => '1.7'
. These are work-arounds, but they won't fix the Hydrogen package - and we also can't fix on our end, because their code is wrong...
That's fair. I'll move this to Hydrogen then, to see what they make of it. Thanks again @mauricioszabo!
@LRydin I did a PR: https://github.com/nteract/hydrogen/pull/2162
Sweet! You move fast @mauricioszabo :P. Cheers!
Thanks in advance for your bug report!
What happened?
Prerequisites
Description
Classic shift-Enter to run single line on python (Hydrogen) throws error.
Steps to Reproduce
import os
)Expected behavior:
run (equivalent to
hydrogen:run
)Actual behavior:
throws error: editor.languageMode.rowRangeForCodeFoldAtBufferRow is not a function
Versions
Atom: 1.100.0-beta x64 Electron: 12.2.3 OS: Ubuntu 22.10 Thrown From: Hydrogen package 2.16.3
Stack Trace
Uncaught TypeError: editor.languageMode.rowRangeForCodeFoldAtBufferRow is not a function
Commands
Non-Core Packages
Which OS does this happen on?
🐧 Debian based (Linux Mint, Ubuntu, etc.)
OS details
Ubuntu 22.10 (Kernel: 5.19.17-051917-generic)
Which CPU architecture are you running this on?
64-bit(x86_64)
What steps are needed to reproduce this?
Description
Classic shift-Enter to run single line on python (Hydrogen) throws error.
Steps to Reproduce
import os
)Expected behavior:
run (equivalent to
hydrogen:run
)Actual behavior:
throws error: editor.languageMode.rowRangeForCodeFoldAtBufferRow is not a function
Additional Information:
atom
with hydrogen and it runs fine (thus python is correctly set up).