Closed mdjaere closed 6 years ago
Yes, it's intentional. After a ;
, IJavascript (and ITypescript) include all global variables and keywords in the autocompletion list.
$$
is an important global variable for IJavascript. It's provided by IJavascript so that users can communicate with frontends (hydrogen, nteract, Jupyter notebook, ...).
$$
allows the user to customise an execution result or provide it asynchronously. For more details, see the documentation: doc/async.ipynb and doc/custom.ipynb.
$$
also provides other experimental functionality, like $$.input()
and $$.display()
, but I haven't documented them yet.
Thanks for the explanation!
It makes sense to have variables and keywords available, but I'm not sure it improves the user experience in this case. In JS you'll often use a ;
followed by a line feed, but now, if you're not careful, you'll end up with $$, losing the line feed. Slightly confusing and hinders coding flow IMO. I am not sure how the system works, but you might want some exclusions/inclusions on what triggers auto-suggestions.
This is usually handled by the frontend (in your case, I guess, it's Hydrogen).
I've just opened a request on Hydrogen's repo. See https://github.com/nteract/hydrogen/issues/1198 .
Yep, it's Hydrogen. They sent me here. Thanks for the update and follow-up.
@mdjaere Note that this issue isn't specific to IJavascript, the python kernel also shows globals and keywords after ;
. That's the reason why I think, it should be handled at frontend level.
That makes sense, thanks for clearing up. I'll close this now.
Hi, Thanks for a great project.
I am using the Atom Hydrogen plugin with https://www.npmjs.com/package/itypescript, which is built on IJavascript. When ending the line with a semicolon, it suggests autocompletion to $$. Is this intentional or accidental?
Thank you