MCPcopy Create free account
hub / github.com/fabioz/PyDev.Debugger / map_to_client

Method map_to_client

_pydevd_bundle/pydevd_source_mapping.py:85–98  ·  view source on GitHub ↗
(self, runtime_source_filename, lineno)

Source from the content-addressed store, hash-verified

83 return ""
84
85 def map_to_client(self, runtime_source_filename, lineno):
86 key = (lineno, "client", runtime_source_filename)
87 try:
88 return self._cache[key]
89 except KeyError:
90 for _, mapping in list(self._mappings_to_server.items()):
91 for map_entry in mapping:
92 if map_entry.runtime_source == runtime_source_filename: # <cell1>
93 if map_entry.contains_runtime_line(lineno): # matches line range
94 self._cache[key] = (map_entry.source_filename, map_entry.line + (lineno - map_entry.runtime_line), True)
95 return self._cache[key]
96
97 self._cache[key] = (runtime_source_filename, lineno, False) # Mark that no translation happened in the cache.
98 return self._cache[key]
99
100 def has_mapping_entry(self, runtime_source_filename):
101 """

Callers 2

test_source_mappingFunction · 0.95

Calls 2

itemsMethod · 0.80
contains_runtime_lineMethod · 0.80

Tested by 1

test_source_mappingFunction · 0.76