Skip to content

Commit 97da86a

Browse files
committed
DAP: sort by instance variable names
fix #798
1 parent 2f510f0 commit 97da86a

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

lib/debug/server_dap.rb

+2-5
Original file line numberDiff line numberDiff line change
@@ -819,10 +819,7 @@ def process_dap args
819819
]
820820
vars << variable('#dump', NaiveString.new(obj)) if obj.length > MAX_LENGTH
821821
when Class, Module
822-
vars = obj.instance_variables.map{|iv|
823-
variable(iv, obj.instance_variable_get(iv))
824-
}
825-
vars.unshift variable('%ancestors', obj.ancestors[1..])
822+
vars << variable('%ancestors', obj.ancestors[1..])
826823
when Range
827824
vars = [
828825
variable('#begin', obj.begin),
@@ -831,7 +828,7 @@ def process_dap args
831828
end
832829

833830
unless NaiveString === obj
834-
vars += M_INSTANCE_VARIABLES.bind_call(obj).map{|iv|
831+
vars += M_INSTANCE_VARIABLES.bind_call(obj).sort.map{|iv|
835832
variable(iv, M_INSTANCE_VARIABLE_GET.bind_call(obj, iv))
836833
}
837834
vars.unshift variable('#class', M_CLASS.bind_call(obj))

0 commit comments

Comments
 (0)