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

Method getPos

valdi/vscode_debugger/src/ui/npmScriptLens.ts:116–120  ·  view source on GitHub ↗
(offset: number)

Source from the content-addressed store, hash-verified

114 let level = 0;
115 const text = document.getText();
116 const getPos = (offset: number) => {
117 const line = text.slice(0, offset).match(/\n/g)?.length ?? 0;
118 const character = offset - Math.max(0, text.lastIndexOf('\n', offset));
119 return new Position(line, character);
120 };
121
122 const scripts: { name: string; value: string; position: Position }[] = [];
123

Callers

nothing calls this directly

Calls 2

lastIndexOfMethod · 0.80
matchMethod · 0.45

Tested by

no test coverage detected