MCPcopy Create free account
hub / github.com/prettier/prettier / getElementWithSameLocation

Function getElementWithSameLocation

src/language-html/parse/parse.js:72–81  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

70 }));
71
72 const getElementWithSameLocation = (node) => {
73 const { offset } = node.startSourceSpan.start;
74 return (
75 getHtmlParseResult().rootNodes.find(
76 (searching) =>
77 searching.kind === "element" &&
78 searching.startSourceSpan.start.offset === offset,
79 ) ?? node
80 );
81 };
82 for (const [index, node] of rootNodes.entries()) {
83 if (node.kind !== "element") {
84 continue;

Callers 1

parseVueFunction · 0.85

Calls 1

getHtmlParseResultFunction · 0.85

Tested by

no test coverage detected