connorshea / vscode-ruby-test-adapter

A Ruby test adapter extension for the VS Code Test Explorer
https://marketplace.visualstudio.com/items?itemName=connorshea.vscode-ruby-test-adapter
MIT License
85 stars 52 forks source link

Able to run tests, but not debug #94

Closed thomthom closed 2 years ago

thomthom commented 2 years ago

Your environment

settiongs.json

{
  "solargraph.diagnostics": true,
  // https://github.com/connorshea/vscode-ruby-test-adapter/issues/86#issue-1064452536
  "rubyTestExplorer.debugCommand": "bundle exec rdebug-ide -I src -I tests/standalone/helpers",
  "rubyTestExplorer.minitestCommand": "bundle exec rake -I src -I tests/standalone/helpers",
  "rubyTestExplorer.minitestDirectory": "./tests/standalone",
  "rubyTestExplorer.logpanel": true,
  // As of VSCode 1.59 there is now a native Test Explorer UI.
  // "testExplorer.useNativeTesting": true
}

Expected behavior

image

I was expecting the selected test to run with the debugger attached.

Actual behavior

When I try to debug a failed test from the Test Explorer I get the following errors in the Developer Console instead of the debugger breaking at my breakpoints:

console.ts:137 [Extension Host] rejected promise not handled within 1 second: SyntaxError: Unexpected end of JSON input
E @ console.ts:137
$logExtensionHostMessage @ mainThreadConsole.ts:39
_doInvokeHandler @ rpcProtocol.ts:473
_invokeHandler @ rpcProtocol.ts:458
_receiveRequest @ rpcProtocol.ts:374
_receiveOneMessage @ rpcProtocol.ts:296
(anonymous) @ rpcProtocol.ts:161
invoke @ event.ts:575
deliver @ event.ts:779
fire @ event.ts:740
fire @ ipc.net.ts:638
_receiveMessage @ ipc.net.ts:958
(anonymous) @ ipc.net.ts:831
invoke @ event.ts:575
deliver @ event.ts:779
fire @ event.ts:740
acceptChunk @ ipc.net.ts:382
(anonymous) @ ipc.net.ts:338
O @ ipc.net.ts:60
emit @ node:events:390
addChunk @ node:internal/streams/readable:315
readableAddChunk @ node:internal/streams/readable:289
Readable.push @ node:internal/streams/readable:228
onStreamRead @ node:internal/stream_base_commons:199
console.ts:137 [Extension Host] stack trace: SyntaxError: Unexpected end of JSON input  at JSON.parse (<anonymous>) at MinitestTests.<anonymous> (c:\Users\Thomas\.vscode\extensions\connorshea.vscode-ruby-test-adapter-0.9.0\out\src\tests.js:293:45) at Generator.next (<anonymous>) at fulfilled (c:\Users\Thomas\.vscode\extensions\connorshea.vscode-ruby-test-adapter-0.9.0\node_modules\tslib\tslib.js:114:62)  at processTicksAndRejections (node:internal/process/task_queues:96:5)
E @ console.ts:137
$logExtensionHostMessage @ mainThreadConsole.ts:39
_doInvokeHandler @ rpcProtocol.ts:473
_invokeHandler @ rpcProtocol.ts:458
_receiveRequest @ rpcProtocol.ts:374
_receiveOneMessage @ rpcProtocol.ts:296
(anonymous) @ rpcProtocol.ts:161
invoke @ event.ts:575
deliver @ event.ts:779
fire @ event.ts:740
fire @ ipc.net.ts:638
_receiveMessage @ ipc.net.ts:958
(anonymous) @ ipc.net.ts:831
invoke @ event.ts:575
deliver @ event.ts:779
fire @ event.ts:740
acceptChunk @ ipc.net.ts:382
(anonymous) @ ipc.net.ts:338
O @ ipc.net.ts:60
emit @ node:events:390
addChunk @ node:internal/streams/readable:315
readableAddChunk @ node:internal/streams/readable:289
Readable.push @ node:internal/streams/readable:228
onStreamRead @ node:internal/stream_base_commons:199
mainThreadExtensionService.ts:79 [[object Object]]Unexpected end of JSON input
$onExtensionRuntimeError @ mainThreadExtensionService.ts:79
_doInvokeHandler @ rpcProtocol.ts:473
_invokeHandler @ rpcProtocol.ts:458
_receiveRequest @ rpcProtocol.ts:374
_receiveOneMessage @ rpcProtocol.ts:296
(anonymous) @ rpcProtocol.ts:161
invoke @ event.ts:575
deliver @ event.ts:779
fire @ event.ts:740
fire @ ipc.net.ts:638
_receiveMessage @ ipc.net.ts:958
(anonymous) @ ipc.net.ts:831
invoke @ event.ts:575
deliver @ event.ts:779
fire @ event.ts:740
acceptChunk @ ipc.net.ts:382
(anonymous) @ ipc.net.ts:338
O @ ipc.net.ts:60
emit @ node:events:390
addChunk @ node:internal/streams/readable:315
readableAddChunk @ node:internal/streams/readable:289
Readable.push @ node:internal/streams/readable:228
onStreamRead @ node:internal/stream_base_commons:199
mainThreadExtensionService.ts:80 SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at MinitestTests.<anonymous> (c:\Users\Thomas\.vscode\extensions\connorshea.vscode-ruby-test-adapter-0.9.0\out\src\tests.js:293:45)
    at Generator.next (<anonymous>)
    at fulfilled (c:\Users\Thomas\.vscode\extensions\connorshea.vscode-ruby-test-adapter-0.9.0\node_modules\tslib\tslib.js:114:62)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

image

I'm not sure what kind of JSON input it's complaining about. Any ideas of what is going on or what I can do to get more insight to what's going on?

thomthom commented 2 years ago

I think I figured this one out; I had to add debase and ruby-debug-ide gems to my Gemfile:

group :development do
  gem 'debase', '~> 0.2'         # VSCode debugging
  gem 'ruby-debug-ide', '~> 0.7' # VSCode debugging
  gem 'solargraph'               # VSCode IDE support
end