MCPcopy Create free account
hub / github.com/Snapchat/Valdi / rawLocation

Method rawLocation

valdi/vscode_debugger/src/adapter/threads.ts:730–751  ·  view source on GitHub ↗
(
    location: Cdp.Runtime.CallFrame | Cdp.Debugger.CallFrame | Cdp.Debugger.Location,
  )

Source from the content-addressed store, hash-verified

728 }
729
730 rawLocation(
731 location: Cdp.Runtime.CallFrame | Cdp.Debugger.CallFrame | Cdp.Debugger.Location,
732 ): RawLocation {
733 // Note: cdp locations are 0-based, while ui locations are 1-based. Also,
734 // some we can *apparently* get negative locations; Vue's "hello world"
735 // project was observed to emit source locations at (-1, -1) in its callframe.
736 if ('location' in location) {
737 const loc = location as Cdp.Debugger.CallFrame;
738 return {
739 url: loc.url,
740 lineNumber: Math.max(0, loc.location.lineNumber) + 1,
741 columnNumber: Math.max(0, loc.location.columnNumber || 0) + 1,
742 scriptId: loc.location.scriptId,
743 };
744 }
745 return {
746 url: (location as Cdp.Runtime.CallFrame).url || '',
747 lineNumber: Math.max(0, location.lineNumber) + 1,
748 columnNumber: Math.max(0, location.columnNumber || 0) + 1,
749 scriptId: location.scriptId,
750 };
751 }
752
753 public async rawLocationToUiLocation(
754 rawLocation: RawLocation,

Callers 6

_revealObjectMethod · 0.95
fromRuntimeMethod · 0.80
fromDebuggerMethod · 0.80
scopesMethod · 0.80
updateUiLocationsFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected