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.
Sourcecode auto formatter error
-
- CodeLite Curious
- Posts: 8
- Joined: Thu Mar 23, 2017 8:45 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
- eranif
- CodeLite Plugin
- Posts: 6375
- Joined: Wed Feb 06, 2008 9:29 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Sourcecode auto formatter error
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)
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)
Make sure you have read the HOW TO POST thread
-
- CodeLite Curious
- Posts: 8
- Joined: Thu Mar 23, 2017 8:45 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Sourcecode auto formatter error
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
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
- eranif
- CodeLite Plugin
- Posts: 6375
- Joined: Wed Feb 06, 2008 9:29 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Sourcecode auto formatter error
when you run this command from a CMD shell, what is the result that you get:
Replace "YOUR-FILE" with the actual file you want to format and see what happens
Thanks
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"
Thanks
Make sure you have read the HOW TO POST thread
-
- CodeLite Curious
- Posts: 8
- Joined: Thu Mar 23, 2017 8:45 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Sourcecode auto formatter error
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.
(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.
- eranif
- CodeLite Plugin
- Posts: 6375
- Joined: Wed Feb 06, 2008 9:29 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Sourcecode auto formatter error
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
Code: Select all
LC_ALL=C
Eran
Make sure you have read the HOW TO POST thread
-
- CodeLite Curious
- Posts: 8
- Joined: Thu Mar 23, 2017 8:45 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Sourcecode auto formatter error
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.
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.
-
- CodeLite Curious
- Posts: 8
- Joined: Thu Mar 23, 2017 8:45 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Sourcecode auto formatter error
By the way, compiling programs is working.
-
- CodeLite Curious
- Posts: 8
- Joined: Thu Mar 23, 2017 8:45 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Sourcecode auto formatter error
Ok, I found something: If I switch the formatter from clang-format to AStyle, it's working!