Inject Language/Reference doesn't work in string contexts but works in comment contexts

Inject Language/Reference doesn't work in string contexts but works in comment contexts.
Could you tell me how to use it in string contexts?

For example:

 
# select * from users; <- Manually I can inject sql by using intensions(alt + enter).
def hoge
  'select * from users;' <- I can not inject sql.
 
  %Q(select * from users)  <- I can not inject sql. 
 
  # select * from users;  <- I can inject sql.

<<-SQL
select * from users where id = 1; <- Automatically sql is injected.
SQL
end


Thanks

2 comments
Comment actions Permalink

Hi,

this is by design: we do not provide injections into regular ruby strings.
I'd suggest to file feature request in our tracker (https://youtrack.jetbrains.com/issues/RUBY) and we will see how many users actually need such finctionality.

Regards, Oleg.

0

Please sign in to leave a comment.