Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Thomas Schöps
kdevelop
Commits
88861caf
Commit
88861caf
authored
Jul 14, 2019
by
Daniel Mensinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a predefined clang-format custom script formater
parent
d1f58562
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
plugins/customscript/customscript_plugin.cpp
plugins/customscript/customscript_plugin.cpp
+10
-0
No files found.
plugins/customscript/customscript_plugin.cpp
View file @
88861caf
...
...
@@ -249,6 +249,15 @@ KDevelop::SourceFormatterStyle CustomScriptPlugin::predefinedStyle(const QString
result
.
setCaption
(
i18n
(
"Gnu Indent: Original Berkeley indent style"
));
result
.
setContent
(
QStringLiteral
(
"indent -orig"
));
result
.
setUsePreview
(
true
);
}
else
if
(
name
==
QLatin1String
(
"clang_format"
))
{
result
.
setCaption
(
i18n
(
"Clang Format"
));
result
.
setContent
(
QStringLiteral
(
"clang-format -assume-filename=
\"
$FILE
\"
"
));
result
.
setUsePreview
(
false
);
result
.
setDescription
(
i18n
(
"Description:<br /><br />"
"<b>clang-format</b> is an automatic source formater by the LLVM"
"project. It supports a variety of formating style options via"
"a <b>.clang-format</b> configuration file, usually located in"
"the project root directory."
));
}
else
if
(
name
==
QLatin1String
(
"kdev_format_source"
))
{
result
.
setCaption
(
QStringLiteral
(
"KDevelop: kdev_format_source"
));
result
.
setContent
(
QStringLiteral
(
"kdev_format_source $FILE $TMPFILE"
));
...
...
@@ -288,6 +297,7 @@ QVector<KDevelop::SourceFormatterStyle> CustomScriptPlugin::predefinedStyles() c
{
const
QVector
<
KDevelop
::
SourceFormatterStyle
>
styles
=
stylesFromLanguagePlugins
()
+
QVector
<
KDevelop
::
SourceFormatterStyle
>
{
predefinedStyle
(
QStringLiteral
(
"kdev_format_source"
)),
predefinedStyle
(
QStringLiteral
(
"clang_format"
)),
predefinedStyle
(
QStringLiteral
(
"GNU_indent_GNU"
)),
predefinedStyle
(
QStringLiteral
(
"GNU_indent_KR"
)),
predefinedStyle
(
QStringLiteral
(
"GNU_indent_orig"
)),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment