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

Method GetStyle

CodeFormat/src/FormatContext.cpp:162–178  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

160}
161
162LuaStyle FormatContext::GetStyle(std::string_view path) const {
163 std::shared_ptr<LuaEditorConfig> editorConfig = nullptr;
164 std::size_t matchProcess = 0;
165 for (auto &config: _configs) {
166 if (string_util::StartWith(path, config.Workspace)) {
167 if (config.Workspace.size() >= matchProcess) {
168 matchProcess = config.Workspace.size();
169 editorConfig = config.Editorconfig;
170 }
171 }
172 }
173
174 if (editorConfig) {
175 return editorConfig->Generate(path);
176 }
177 return _defaultStyle;
178}
179
180WorkMode FormatContext::GetWorkMode() const {
181 return _workMode;

Callers 15

CheckMethod · 0.80
CheckWorkspaceMethod · 0.80
ReformatMethod · 0.80
RangeReformatMethod · 0.80
ReformatWorkspaceMethod · 0.80
EndWithNewLineMethod · 0.80
BasicResolveMethod · 0.80
WriteIndentMethod · 0.80
GetFormatResultMethod · 0.80
WriteSyntaxNodeMethod · 0.80
DoResolveMethod · 0.80

Calls 2

GenerateMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected