MCPcopy Create free account
hub / github.com/thetarnav/solid-devtools / getNodeLocationAttribute

Function getNodeLocationAttribute

packages/main/src/babel/babel.ts:236–249  ·  view source on GitHub ↗
(
    node:     t.Node,
    filename: string,
    isJSX = false,
)

Source from the content-addressed store, hash-verified

234 `${filePath}:${line}:${column}`
235
236function getNodeLocationAttribute(
237 node: t.Node,
238 filename: string,
239 isJSX = false,
240): string | undefined {
241 if (node.loc) {
242 return getLocationAttribute(
243 path.relative(process.cwd(), filename),
244 node.loc.start.line,
245 // 2 is added to place the caret after the "<" character
246 node.loc.start.column + (isJSX ? 2 : 0),
247 )
248 }
249}
250
251export type JsxLocationPluginConfig = {
252 jsx: boolean

Callers 2

addLocationToBodyFunction · 0.85
JSXOpeningElementFunction · 0.85

Calls 1

getLocationAttributeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…