LoginSignup
5
2

More than 3 years have passed since last update.

VScodeでpryと打つとbinding.pryに変換してくれる設定

Last updated at Posted at 2020-06-06

はじめに

Railsで開発していると必ず使うであろうデバッグ(binding.pry)をVScodeで簡単に出せる方法を紹介します。

設定

1 VScode上でcommand +shift + P → Configure User Snippetsを選択

スクリーンショット 2020-06-06 20.37.56.png

2 ruby.jsonを選択

スクリーンショット 2020-06-06 20.38.56.png

3 下記のコードを追加

"prefix"の値を変えるとpryではなく好きな文字からbinding.pryに変換できます。

ruby.json
"Debug Console": {
  "prefix": "pry",
  "body": "binding.pry\n",
  "description": "A runtime developer console"
}

4 pry + Enterで binding.pryに変換される

ezgif.com-video-to-gif.gif

5
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
2