MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / MakeDiagnosticInfo

Method MakeDiagnosticInfo

CodeFormatCLib/src/CodeFormat.cpp:227–242  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

225}
226
227std::vector<LuaDiagnosticInfo> CodeFormat::MakeDiagnosticInfo(const std::vector<LuaDiagnostic> &diagnostics,
228 std::shared_ptr<LuaSource> file) {
229 std::vector<LuaDiagnosticInfo> results;
230 for (auto &diagnostic: diagnostics) {
231 auto &result = results.emplace_back();
232 result.Type = diagnostic.Type;
233 result.Message = diagnostic.Message;
234 result.Data = diagnostic.Data;
235 result.Start.Line = file->GetLine(diagnostic.Range.StartOffset);
236 result.Start.Col = file->GetColumn(diagnostic.Range.StartOffset);
237 result.End.Line = file->GetLine(diagnostic.Range.GetEndOffset());
238 result.End.Col = file->GetColumn(diagnostic.Range.GetEndOffset()) + 1;
239 }
240
241 return results;
242}

Callers

nothing calls this directly

Calls 3

GetLineMethod · 0.80
GetColumnMethod · 0.80
GetEndOffsetMethod · 0.45

Tested by

no test coverage detected