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

Method Reformat

CodeFormat/src/LuaFormat.cpp:16–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14#include <iostream>
15
16bool LuaFormat::Reformat(const FormatContext &context) {
17 switch (context.GetWorkMode()) {
18 case WorkMode::File:
19 case WorkMode::Stdin: {
20 auto outPath = context.GetOutputPath();
21 auto text = context.GetInputText();
22 auto inputPath = context.GetInputPath();
23 auto style = context.GetStyle(inputPath);
24 return ReformatSingleFile(context, outPath, std::move(text), style);
25 }
26 case WorkMode::Workspace: {
27 return ReformatWorkspace(context);
28 }
29 }
30 return false;
31}
32
33bool LuaFormat::ReformatSingleFile(const FormatContext &context, std::string_view outPath, std::string &&sourceText, LuaStyle style) {
34 auto file = LuaSource::From(std::move(sourceText));

Callers 1

mainFunction · 0.45

Calls 5

GetWorkModeMethod · 0.80
GetOutputPathMethod · 0.80
GetInputTextMethod · 0.80
GetInputPathMethod · 0.80
GetStyleMethod · 0.80

Tested by

no test coverage detected