MCPcopy Create free account
hub / github.com/KDE/kdevelop / formatSourceWithStyle

Method formatSourceWithStyle

plugins/astyle/astyle_plugin.cpp:258–279  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

256}
257
258QString AStylePlugin::formatSourceWithStyle(const SourceFormatterStyle& style,
259 const QString& text,
260 const QUrl& /*url*/,
261 const QMimeType& mime,
262 const QString& leftContext,
263 const QString& rightContext) const
264{
265 if(mime.inherits(QStringLiteral("text/x-java")))
266 m_formatter->setJavaStyle();
267 else if(mime.inherits(QStringLiteral("text/x-csharp")))
268 m_formatter->setSharpStyle();
269 else
270 m_formatter->setCStyle();
271
272 if (style.content().isEmpty()) {
273 m_formatter->predefinedStyle(style.name());
274 } else {
275 m_formatter->loadStyle(style.content());
276 }
277
278 return m_formatter->formatSource(text, leftContext, rightContext);
279}
280
281static SourceFormatterStyle createPredefinedStyle(const QString& name, const QString& caption = QString())
282{

Callers 3

formatMethod · 0.45
updatePreviewMethod · 0.45
showPreviewMethod · 0.45

Calls 9

loadStyleMethod · 0.80
formatSourceMethod · 0.80
setJavaStyleMethod · 0.45
setSharpStyleMethod · 0.45
setCStyleMethod · 0.45
isEmptyMethod · 0.45
contentMethod · 0.45
predefinedStyleMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected