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.

Comment handling of array access within do block

See original GitHub issue

Metadata

Input

list.each do |item|
  # Some comment
  puts item[0]
end

Current output

list.each do |item|
  puts # Some comment
       item[
         0
       ]
end

Expected output

list.each do |item|
  # Some comment
  puts item[0]
end

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
kddnewtoncommented, May 2, 2019

Finally have a fix for this

1reaction
AlanFostercommented, Feb 22, 2019

@NoahTheDuke Definitely not - PEBKAC. Updated the before/after - thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Accessing a C array of blocks inside a block - Stack Overflow
1 Answer 1 · In C arrays are pointers are closely interrelated. · As you have discovered you cannot capture a local array...
Read more >
Accessing array out of bounds in C/C++ - GeeksforGeeks
Stay inside the bounds of the array in C programming while using arrays to avoid any such errors. C++ however offers the std::vector...
Read more >
How To Work with Arrays in Ruby - DigitalOcean
In this tutorial, you'll create arrays, access the values they contain, add, modify, and remove elements in an array, and iterate through ...
Read more >
Chapter 7: Arrays - cs.utsa.edu
This just declares a variable that can hold an array, but does not create the array itself. For example, to declare a variable,...
Read more >
4. Pointers and Arrays - Understanding and Using C ... - O'Reilly
That is, when we access the array using only one subscript, ... In the section Pointers and Multidimensional Arrays, we will examine this...
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