We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d67b82e commit 65a44e8Copy full SHA for 65a44e8
2 files changed
lib/rbi/printer.rb
@@ -675,6 +675,13 @@ def oneline?(node)
675
node.comments.empty? && node.empty?
676
when Attr
677
node.comments.empty? && node.sigs.empty?
678
+ when Const
679
+ return false unless node.comments.empty?
680
+
681
+ loc = node.loc
682
+ return true unless loc
683
684
+ loc.begin_line == loc.end_line
685
when Method
686
node.comments.empty? && node.sigs.empty? && node.params.all? { |p| p.comments.empty? }
687
when Sig
test/rbi/printer_test.rb
@@ -1113,8 +1113,10 @@ class << self; end
1113
class TE < T::Enum; end
1114
# file.rbi:1:3-2:4
1115
class TS < T::Struct; end
1116
1117
1118
C = 42
1119
1120
1121
extend E
1122
0 commit comments