question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

operation(a: 1) { |s| s.to_i } becomes operation(a: 1)(&:to_i) which is invalid ruby

See original GitHub issue

Metadata

  • Ruby version: ruby 2.7.0dev (2019-03-18 trunk 67296) [x86_64-darwin17]
  • @prettier/plugin-ruby version: 0.10.0

Input

operation(a: 1) { |s| s.to_i }

Current output

operation(a: 1)(&:to_i)

Expected output

operation(a: 1, &:to_i)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
stevenpetrykcommented, Apr 2, 2019

I’ll take a crack at it 😃

1reaction
kddnewtoncommented, Apr 1, 2019

Yup - thanks. Will get this fixed. If anyone’s looking for a contribution, the toProcTransform function needs to be moved up the AST to be at the arguments level and not the individual block level.

Read more comments on GitHub >

github_iconTop Results From Across the Web

String manipulation challenge - ruby
Let's begin by constucting a method that computes the weight of each string. def weight(s) base = 'a'.ord - 1 s.each_char.
Read more >
Solving "invalid byte sequence in UTF-8" errors in ruby
Every character in UTF-8 is a sequence of 1 up to 4 bytes. ... So, the following operation will result in the infamous...
Read more >
Active Record Validations and Callbacks
If any validations fail, the object will be marked as invalid and Active Record will not perform the INSERT or UPDATE operation. This...
Read more >
FES re operation of facility.
Erie, via a submerged jet, will be heated no more than 20*F above the ambient lake water temperature. Although some small fish and...
Read more >
qandamaster471.xml
... -s-equvalen-aly-braic-expression-involving-sin-2-co5x-1-positive-q30511196 0.8 ... https://www.chegg.com/homework-help/questions-and-answers/operating- ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found