AlCode AlCode - 3 months ago 15
Ruby Question

Snippet not working

So I'm searching desperately for an example of how to create multiple snippets which work. I have the following:

.source.ruby':
'Passenger':
'prefix': 'passenger'
'body': """
require 'debugger'
Debugger.wait_connection = true
Debugger.start_remote
debugger
"""
'debugger':
'prefix': 'debugger'
'body': """
require 'debugger'
Debugger.start
debugger
"""


The first one works fine, but the second one doesn't.

What am I doing wrong that my debugger snippet is not working? Can someone please explain this??

Answer

I believe it's an issue with your indentation, everything starting from 'debugger' is indented one space less than 'Passenger' snippet. Either remove one space in every line for passenger snippet or add one in every line in debugger snippet.

This code works fine for me:

'.source.ruby':
   'Passenger':
     'prefix': 'passenger'
     'body': """
       require 'debugger'
       Debugger.wait_connection = true
       Debugger.start_remote
       debugger
     """
   'debugger':
     'prefix': 'debugger'
     'body': """
       require 'debugger'
       Debugger.start
       debugger
     """