MCPcopy Create free account
hub / github.com/microsoft/debugpy / _describe_message

Function _describe_message

tests/timeline.py:766–784  ·  view source on GitHub ↗
(message_type, *items)

Source from the content-addressed store, hash-verified

764
765
766def _describe_message(message_type, *items):
767 items = (("type", message_type),) + items
768 d = collections.OrderedDict(items)
769
770 # Keep it all on one line if it's short enough, but indent longer ones.
771 for format_string in "{0:indent=None}", "{0}":
772 s = format_string.format(json.repr(d))
773 s = "{..., " + s[1:]
774
775 # Used by some.dict.containing to inject ... as needed.
776 s = s.replace('"\\u0002...": "...\\u0003"', "...")
777 # Used by some.* and by Event/Request/Response expectations below.
778 s = s.replace('"\\u0002', "")
779 s = s.replace('\\u0003"', "")
780
781 if len(s) <= SINGLE_LINE_REPR_LIMIT:
782 break
783
784 return s
785
786
787def Event(event, body=some.object):

Callers 3

EventFunction · 0.85
RequestFunction · 0.85
ResponseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…