MCPcopy Create free account
hub / github.com/argotorg/solidity / toRange

Method toRange

libsolidity/lsp/HandlerBase.cpp:34–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32using namespace solidity;
33
34Json HandlerBase::toRange(SourceLocation const& _location) const
35{
36 if (!_location.hasText())
37 return toJsonRange({}, {});
38
39 solAssert(_location.sourceName, "");
40 langutil::CharStream const& stream = charStreamProvider().charStream(*_location.sourceName);
41 LineColumn start = stream.translatePositionToLineColumn(_location.start);
42 LineColumn end = stream.translatePositionToLineColumn(_location.end);
43 return toJsonRange(start, end);
44}
45
46Json HandlerBase::toJson(SourceLocation const& _location) const
47{

Callers

nothing calls this directly

Calls 3

toJsonRangeFunction · 0.85
hasTextMethod · 0.80

Tested by

no test coverage detected