misogi / vscode-ruby-rubocop

Rubocop extension for Visual Studio Code
https://marketplace.visualstudio.com/items/misogi.ruby-rubocop
MIT License
137 stars 68 forks source link

Unexpected token u: SyntaxError: Unexpected token u #17

Closed orospakr closed 8 years ago

orospakr commented 8 years ago

Tried using the extension, nothing happens on save/manually running "Execute rubocop", discovered this in the Console:

shell.ts:416Unexpected token u: SyntaxError: Unexpected token u
    at Object.parse (native)
    at onDidExec (/Users/orospakr/.vscode/extensions/misogi.ruby-rubocop-0.2.0/out/src/rubocop.js:40:32)
    at ChildProcess.exithandler (child_process.js:221:5)
    at emitTwo (events.js:100:13)
    at ChildProcess.emit (events.js:185:7)
    at maybeClose (internal/child_process.js:850:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5)
misogi commented 8 years ago

This extension expect JSON output by rubocop. In this case, command outputs non-JSON output by some reason (I don't know reason). 😕

I released version 0.2.1. New version catches this case and output exclusive message and (few length of) raw output.