pimentel / atom-r-exec

Send R code to various R consoles from the Atom editor
https://atom.io/packages/r-exec
MIT License
19 stars 8 forks source link

Problems sending selection/whole file from Atom to R.app (Mac) #14

Closed modche closed 9 years ago

modche commented 9 years ago

[Enter steps to reproduce below:]

  1. Install R Package in Atom but then keybinding doesnt work (they work sometimes, but not everytime)
  2. download github code from here and replace all files in /lib with the new files.

Atom Version: 1.0.19 System: Mac OS X 10.11.1 Thrown From: r-exec package, v0.2.0

Stack Trace

Uncaught Error: Cannot find module 'node-osascript'

At module.js:336

Error: Cannot find module 'node-osascript'
  at Module._resolveFilename (module.js:334:15)
  at Function.Module._resolveFilename (/Applications/Atom.app/Contents/Resources/app.asar/src/module-cache.js:383:52)
  at Function.Module._load (module.js:284:25)
  at Module.require (module.js:363:17)
  at require (module.js:382:17)
  at Object.module.exports.rapp (/Users/stoelzle/.atom/packages/r-exec/lib/r-exec.coffee:108:17)
  at Object.module.exports.sendCode (/Users/stoelzle/.atom/packages/r-exec/lib/r-exec.coffee:52:28)
  at Object.module.exports.sendCommand (/Users/stoelzle/.atom/packages/r-exec/lib/r-exec.coffee:38:6)
  at atom-workspace.<anonymous> (/Users/stoelzle/.atom/packages/r-exec/lib/r-exec.coffee:29:34)
  at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:245:29)
  at CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:3:61)
  at CommandRegistry.module.exports.CommandRegistry.dispatch (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:145:19)
  at EventEmitter.<anonymous> (/Applications/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:70:30)
  at emitOne (events.js:77:13)
  at EventEmitter.emit (events.js:169:7)

Commands

     -0:22.2.0 r-exec:send-command (atom-text-editor.editor.is-focused)
     -0:09.0 editor:consolidate-selections (atom-text-editor.editor.is-focused)
     -0:09.0 core:cancel (atom-text-editor.editor.is-focused)
     -0:05.6.0 symbols-view:toggle-project-symbols (atom-text-editor.editor.is-focused)
     -0:04.7.0 editor:consolidate-selections (atom-text-editor.editor.mini.is-focused)
     -0:04.7.0 core:cancel (atom-text-editor.editor.mini.is-focused)
     -0:00.5.0 r-exec:send-command (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "themes": [
      "atom-dark-ui",
      "base16-tomorrow-dark-theme"
    ],
    "packagesWithKeymapsDisabled": [
      "r-exec"
    ]
  },
  "r-exec": {
    "whichApp": "R.app",
    "advancePosition": true,
    "focusWindow": true
  }
}

Installed Packages

# User
gtk-dark-theme, v0.1.4
language-r, v0.3.0
r-exec, v0.2.0

# Dev
No dev packages
pimentel commented 9 years ago

Do you have the following key map set in your ~/.atom/keymap.cson:

'atom-workspace atom-text-editor:not([mini])':
  'cmd-enter': 'r-exec:send-command'
modche commented 9 years ago

No, not yet.But now, I got the same error when I add the two lines. Is Atom installing an older version of the package than actually available at GitHub?

On 22.10.2015, at 16:53, Harold Pimentel notifications@github.com wrote:

Do you have the following key map set in your ~/.atom/keymap.cson:

'atom-workspace atom-text-editor:not([mini])':

'cmd-enter': 'r-exec:send-command' — Reply to this email directly or view it on GitHub.

pimentel commented 9 years ago

I'm not sure about what version atom is hosting. If you have a settings tab, it is the version on GitHub.

modche commented 9 years ago

OK. I deinstall the package, and install it from Atom again. Yes, there is a settings tab, than I added

'atom-workspace atom-text-editor': 'cmd-y': 'r-exec:send-command'

'atom-workspace atom-text-editor:not([mini])': 'cmd-y': 'r-exec:send-command'

to keymap.cson and now it works (I can send lines of code to R, but also the whole code if I select the whole file).

Thx.