Community
Participate
Working Groups
Steps: 1. Create a Ruby Class File | New | Ruby Class < File: [Case7053] > < Finish > 2. Paste the following snippet on the Case7053.rb file. File | Save 3. Type do block from the end of line 4 Place a caret position at end of line 4 (Line: 4, Column: 19) [Enter][list.each][Space][do][Enter] // Type [Enter] key at first and type "list.each do" to start do block, then type [Enter] key again. // exp: The end of line 6 should be terminated by line feed (x0A) which is new line character for ruby. // act: The end of line 6 is terminated by single carriage return (x0D) which is considered as white space in ruby. So, the script would have syntax error when I comment out line 6. # Test snippet 7053 for do block class Case7053 def initialize list = [1,2,3] # list.each do # puts "A" # end end end Case7053.new # End of snippet 7053
Created attachment 112846 [details] Single carriage return character (x0D) is misplaced as new line in do block
Created attachment 112929 [details] Patch to place getDefaultLineDelimiter() string
Now the matching "end" keyword is added in RubyBracketInserter and in RubyAutoEditStrategy classes, so we have duplicate functionality for the same task. We should leave only brackets and quotes in RubyBracketInserter and implement everything else as AutoEditStrategy. Additional linked-mode logic in RubyBracketInserter does not work as designed with multi-line constructs anyway.
I have applied the patch but the code needs refactoring.
I have move smart insert of the "end" keyword after space character from RubyBracketInserter to RubyAutoEditStrategy, so this issue could be closed.
Verified in HEAD. Thanks,