Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RubyMine: key press to "convert to single quoted"?

Is there a keyboard shortcut to toggle between single quotes and double quotes in a Ruby code? Or a key I can set up to accept the Inspection Hint?

Thanks, M.

like image 819
Martin Cleaver Avatar asked Mar 06 '15 15:03

Martin Cleaver


People also ask

Can you use single quotes in Ruby?

Best practice. As most of the Ruby Linters suggest use single quote literals for your strings and go for the double ones in the case of interpolation/escaping sequences.

What is single quote in PHP?

Single or double quotes in PHP programming are used to define a string. But, there are lots of differences between these two. Single-quoted Strings: It is the easiest way to define a string. You can use it when you want the string to be exactly as it is written.


2 Answers

To accept any inspection hint in RubyMine, press Alt+Enter and then use the arrow keys and Enter to select the quickfix to apply.

like image 159
yole Avatar answered Sep 19 '22 05:09

yole


Current as of RubyMine 2016.2, there is an easier way to convert all quotes via the keyboard:

  • select part of string whose quotation type you want to change
  • Alt + Enter to accept inspection hint
  • Arrow right
  • "Fix all 'Double quoted string' problems in file"

Fix all option in RubyMine

like image 22
ckib16 Avatar answered Sep 23 '22 05:09

ckib16