Page 1 of 1
Sourcecode auto formatter error
Posted: Mon Apr 17, 2017 7:36 pm
by Ashmon
When I hit CTRL + I (autoformat sourcecode), all code is deleted and replaced with:
1 konnte nicht gefunden werden.
2
This is german and translates to "was not found". I just reinstalled Windows and don't have a clue, what I did wrong this time! I'm also confused why it is shown in german, when everything else is in English.
Re: Sourcecode auto formatter error
Posted: Mon Apr 17, 2017 8:34 pm
by eranif
1. Which version of CodeLite are you using?
2. Enable the log file of CodeLite from: Settings->Misc->Log->Log verbosity, and set it to DEBUG
Try to format a file and copy the log file content from %appdata%\CodeLite\codelite.log to this thread (try to locate the relevant parts only)
Re: Sourcecode auto formatter error
Posted: Mon Apr 17, 2017 9:17 pm
by Ashmon
I'm using 10.0.3 (latest stable)
I deleted the content of the logfile. This is right after trying to autoformat:
[19:05:09:363 DBG] ContinuousBuild::OnFileSaved
[19:05:09:363 DBG] ContinuousBuild is disabled
[19:05:10:807 DBG] No EditorConfig file found for file: D:\Mega Sync\Benutzer\Ashmon\Documents\Programmieren\Schroedinger\Schroedinger\Strings\main.cpp
[19:05:14:519 DBG] Formatting file: ' D:\Mega Sync\Benutzer\Ashmon\Documents\Programmieren\Schroedinger\Schroedinger\Strings\main.cpp '
[19:05:14:523 DBG] Using C++/Clang formatter
[19:05:14:530 DBG] CodeForamtter: C:\Windows\system32\cmd.exe /C "C:\Program Files\CodeLite\codelite-clang-format.exe" -style="{ BasedOnStyle: WebKit, IndentWidth: 4, UseTab: Never, Language : Cpp , AlignEscapedNewlinesLeft: true, AlignTrailingComments : true, AllowAllParametersOfDeclarationOnNextLine : false, AllowShortFunctionsOnASingleLine : false, AllowShortBlocksOnASingleLine : false, AllowShortLoopsOnASingleLine : false, AllowShortIfStatementsOnASingleLine : false, AlwaysBreakBeforeMultilineStrings : false, AlwaysBreakTemplateDeclarations : false, BinPackParameters : false, BreakBeforeBinaryOperators : false, BreakBeforeTernaryOperators : false, BreakConstructorInitializersBeforeComma : true, IndentCaseLabels : false, IndentFunctionDeclarationAfterType : false, SpaceBeforeAssignmentOperators : true, SpaceBeforeParens : Never, SpacesInParentheses : false, BreakBeforeBraces : Linux, ColumnLimit : 120, PointerAlignment : Left }" -cursor=367 "D:\Mega Sync\Benutzer\Ashmon\Documents\Programmieren\Schroedinger\Schroedinger\Strings\.code-formatter-tmp.cpp"
[19:05:14:583 DBG] Done
[19:05:14:592 DBG] Formatting file: ' D:\Mega Sync\Benutzer\Ashmon\Documents\Programmieren\Schroedinger\Schroedinger\Strings\main.cpp '...is done
[19:05:16:438 DBG] No EditorConfig file found for file: C:\Users\ashmo\AppData\Roaming\codelite\codelite.log
Re: Sourcecode auto formatter error
Posted: Mon Apr 17, 2017 11:43 pm
by eranif
when you run this command from a CMD shell, what is the result that you get:
Code: Select all
C:\Windows\system32\cmd.exe /C "C:\Program Files\CodeLite\codelite-clang-format.exe" -style="{ BasedOnStyle: WebKit, IndentWidth: 4, UseTab: Never, Language : Cpp , AlignEscapedNewlinesLeft: true, AlignTrailingComments : true, AllowAllParametersOfDeclarationOnNextLine : false, AllowShortFunctionsOnASingleLine : false, AllowShortBlocksOnASingleLine : false, AllowShortLoopsOnASingleLine : false, AllowShortIfStatementsOnASingleLine : false, AlwaysBreakBeforeMultilineStrings : false, AlwaysBreakTemplateDeclarations : false, BinPackParameters : false, BreakBeforeBinaryOperators : false, BreakBeforeTernaryOperators : false, BreakConstructorInitializersBeforeComma : true, IndentCaseLabels : false, IndentFunctionDeclarationAfterType : false, SpaceBeforeAssignmentOperators : true, SpaceBeforeParens : Never, SpacesInParentheses : false, BreakBeforeBraces : Linux, ColumnLimit : 120, PointerAlignment : Left }" -cursor=367 "D:\Mega Sync\Benutzer\Ashmon\Documents\Programmieren\Schroedinger\Schroedinger\Strings\YOUR-FILE.cpp"
Replace "YOUR-FILE" with the actual file you want to format and see what happens
Thanks
Re: Sourcecode auto formatter error
Posted: Tue Apr 18, 2017 8:31 am
by Ashmon
It works as expected. This is my Cli:
(don't laugh about the code, it's from an educational book for practice....
)
C:\Program Files\CodeLite>codelite-clang-format.exe -style="{ BasedOnStyle: WebKit, IndentWidth: 4, UseTab: Never, Language : Cpp , AlignEscapedNewlinesLeft: true, AlignTrailingComments : true, AllowAllParametersOfDeclarationOnNextLine : false, AllowShortFunctionsOnASingleLine : false, AllowShortBlocksOnASingleLine : false, AllowShortLoopsOnASingleLine : false, AllowShortIfStatementsOnASingleLine : false, AlwaysBreakBeforeMultilineStrings : false, AlwaysBreakTemplateDeclarations : false, BinPackParameters : false, BreakBeforeBinaryOperators : false, BreakBeforeTernaryOperators : false, BreakConstructorInitializersBeforeComma : true, IndentCaseLabels : false, IndentFunctionDeclarationAfterType : false, SpaceBeforeAssignmentOperators : true, SpaceBeforeParens : Never, SpacesInParentheses : false, BreakBeforeBraces : Linux, ColumnLimit : 120, PointerAlignment : Left }" -cursor=367 "D:\Mega Sync\Benutzer\Ashmon\Documents\Programmieren\Schroedinger\Schroedinger\Strings\main.cpp
{ "Cursor": 382, "IncompleteFormat": false }
#include <iostream>
#include <string>
using namespace std;
int main()
{
string einString01;
string einString02 = "Voll einfach";
einString01 = einString02;
string einString03;
getline(cin, einString03);
cout << einString03 << endl;
char zearray[] = "Ze-Array2String";
string einString04 = zearray;
string einString05(10, '+');
}
C:\Program Files\CodeLite>
the code between the curly brackets is moved back to the left corner by the forum. However, I get the expected result.
Re: Sourcecode auto formatter error
Posted: Tue Apr 18, 2017 3:13 pm
by eranif
Can you please set this environment variable in CodeLite: Settings->Environment variables
And try to format the file again, does the message still appears in German? Does it work now?
Eran
Re: Sourcecode auto formatter error
Posted: Tue Apr 18, 2017 9:07 pm
by Ashmon
Still the same problem.
I have only a default set and it now looks like this:
CodeLiteDir=C:\Program Files\CodeLite
LC_ALL=C
Reinstalling Codelite didn't help either.
Re: Sourcecode auto formatter error
Posted: Tue Apr 18, 2017 9:24 pm
by Ashmon
By the way, compiling programs is working.
Re: Sourcecode auto formatter error
Posted: Tue Apr 18, 2017 9:26 pm
by Ashmon
Ok, I found something: If I switch the formatter from clang-format to AStyle, it's working!