Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DAP: add the ability to hide the #class item for each object #986

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions lib/debug/server_dap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,14 @@ def process
send_event :terminated unless @sock.closed?
end

def hide_class_item req
if req.dig('arguments', 'hideClassItem') == true
@hide_class_item = true
else
@hide_class_item = false
end
end

def process_request req
raise "not a request: #{req.inspect}" unless req['type'] == 'request'
args = req.dig('arguments')
Expand All @@ -315,6 +323,7 @@ def process_request req
@nonstop = true

load_extensions req
hide_class_item req

when 'attach'
send_response req
Expand All @@ -327,6 +336,7 @@ def process_request req
end

load_extensions req
hide_class_item req

when 'configurationDone'
send_response req
Expand Down Expand Up @@ -479,9 +489,13 @@ def process_request req
else
@q_msg << req
end
when 'variables'
if @hide_class_item
req['arguments']['hideClassItem'] = true
end
@q_msg << req
when 'stackTrace',
'scopes',
'variables',
'source',
'completions'
@q_msg << req
Expand Down Expand Up @@ -914,7 +928,9 @@ def process_dap args
vars += M_INSTANCE_VARIABLES.bind_call(obj).sort.map{|iv|
variable(iv, M_INSTANCE_VARIABLE_GET.bind_call(obj, iv))
}
vars.unshift variable('#class', M_CLASS.bind_call(obj))
unless req.dig('arguments', 'hideClassItem')
vars.unshift variable('#class', M_CLASS.bind_call(obj))
end
end
end
end
Expand Down