JunoLab / atom-julia-client

Juno a good IDE?
http://junolab.org
MIT License
273 stars 72 forks source link

Evaluating code over Julia-Client service #658

Closed aminya closed 4 years ago

aminya commented 4 years ago

How can I evaluate a Julia code over Julia-Client service? I have added this to my Atom package:

  "consumedServices": {
    "julia-client": {
      "versions": {
        "0.1.0": "consumeClient"
      }
    }

  },

Inside the code I have this:

  consumeClient: (client) ->
    # getting client object
    @client = client

But when I want to evaluate a code I cannot run this for example:

    atom.commands.add 'atom-workspace', 'julia-client:myEval': (event) ->
      @client.msg 'eval', 'a=2+2'

Gives:

TypeError: Cannot read property 'msg' of undefined

There is no example or documentation on how to set the connection here (http://docs.junolab.org/latest/devdocs/communication/)

aviatesk commented 4 years ago

nice try, you can see language-weave as such an example.

aminya commented 4 years ago

@aviatesk how does weave function gets access to juliaClient. I don't see the consumeJuliaClient being called https://github.com/JunoLab/language-weave/blob/a966a5c52c0a402e038d9177e24ca8b59791006b/lib/main.js#L31

Edit: Ahh, there is a global variable