Format current sourcode: operable program or batch file
-
- CodeLite Curious
- Posts: 8
- Joined: Mon May 29, 2017 1:18 pm
- Genuine User: Yes
- IDE Question: PHP
- Contact:
Format current sourcode: operable program or batch file
Hi all,
I tried to use "Format current sourcode".
But when I select my code and choose this function, it delete all my code and appear this line"operable program or batch file."
Anyone know what is my issue, May be i miss some setup or wrong in operate.
Please help me fix this issue.(I'm using windown 10 with newest version of codelite 10.0.4)
Thanks & Best Regards,
Phuong Hoang
I tried to use "Format current sourcode".
But when I select my code and choose this function, it delete all my code and appear this line"operable program or batch file."
Anyone know what is my issue, May be i miss some setup or wrong in operate.
Please help me fix this issue.(I'm using windown 10 with newest version of codelite 10.0.4)
Thanks & Best Regards,
Phuong Hoang
- eranif
- CodeLite Plugin
- Posts: 6375
- Joined: Wed Feb 06, 2008 9:29 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Format current sourcode: operable program or batch file
Please enable CodeLite log and post the log output here.
To enable the log: settings->preferences->misc->log->codelite log level->Debug
The log file can be seen under: %appdata%\CodeLite\codelite.log
To enable the log: settings->preferences->misc->log->codelite log level->Debug
The log file can be seen under: %appdata%\CodeLite\codelite.log
Make sure you have read the HOW TO POST thread
-
- CodeLite Enthusiast
- Posts: 41
- Joined: Mon May 22, 2017 12:06 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Format current sourcode: operable program or batch file
It would also be nice to know if this is for php or c++ and what formatter you have selected under options.
The error you are getting means that windows was not able to locate the formatting tool, so my best guess is that you didn't set the "clang-format path" for c++ or PHP Executable if you are trying to format php.
The error you are getting means that windows was not able to locate the formatting tool, so my best guess is that you didn't set the "clang-format path" for c++ or PHP Executable if you are trying to format php.
-
- CodeLite Curious
- Posts: 8
- Joined: Mon May 29, 2017 1:18 pm
- Genuine User: Yes
- IDE Question: PHP
- Contact:
Re: Format current sourcode: operable program or batch file
@eranif: There is my log:
Please help me find what is the issue?
@Ajenbo: I'm working on C++. Please help me to set "clang-format path" for c+
Code: Select all
[00:06:50:698 DBG] Formatting file: ' C:\Users\hptphuong\Documents\Self C++\learning\first\main_app.cpp '
[00:06:50:698 DBG] Using C++/Clang formatter
[00:06:50:714 DBG] CodeForamtter: C:\Windows\system32\cmd.exe /C "C:\Program Files\CodeLite\codelite-clang-format.exe" -assume-filename=main_app.cpp -style="{ BasedOnStyle: WebKit, IndentWidth: 4, UseTab: ForIndentation, 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 : true, IndentFunctionDeclarationAfterType : true, SpaceBeforeAssignmentOperators : true, SpaceBeforeParens : Never, SpacesInParentheses : false, BreakBeforeBraces : Linux, ColumnLimit : 120, PointerAlignment : Left }" -cursor=0 -offset=0 -length=508 "C:\Users\hptphuong\Documents\Self C++\learning\first\.code-formatter-tmp.cpp"
[00:06:50:808 DBG] Done
[00:06:50:823 DBG] Formatting file: ' C:\Users\hptphuong\Documents\Self C++\learning\first\main_app.cpp '...is done
[00:06:51:886 DBG] No EditorConfig file found for file: C:\Users\hptphuong\AppData\Roaming\codelite\codelite.log
[00:06:54:911 DBG] No EditorConfig file found for file: C:\Users\hptphuong\Documents\Self C++\learning\first\main_app.cpp
@Ajenbo: I'm working on C++. Please help me to set "clang-format path" for c+
- eranif
- CodeLite Plugin
- Posts: 6375
- Joined: Wed Feb 06, 2008 9:29 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Format current sourcode: operable program or batch file
can you try and execute the command from the command line?
Make sure you have read the HOW TO POST thread
-
- CodeLite Curious
- Posts: 8
- Joined: Mon May 29, 2017 1:18 pm
- Genuine User: Yes
- IDE Question: PHP
- Contact:
Re: Format current sourcode: operable program or batch file
@eranif: Please let me know how to do it? one more, it's ridiculous to reindent by code. It's inconvenient. In sublime, i can make it easy with hot key.
- eranif
- CodeLite Plugin
- Posts: 6375
- Joined: Wed Feb 06, 2008 9:29 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Format current sourcode: operable program or batch file
it is also done by hot key in codelite (ctrl-i). it works everywhere, except for you
i wanted you to try and run it from the command line just to see if we get some additional information of why it fails to run from within codelite
i wanted you to try and run it from the command line just to see if we get some additional information of why it fails to run from within codelite
Make sure you have read the HOW TO POST thread
-
- CodeLite Curious
- Posts: 8
- Joined: Mon May 29, 2017 1:18 pm
- Genuine User: Yes
- IDE Question: PHP
- Contact:
Re: Format current sourcode: operable program or batch file
Please help me run it by command line. I don't know how do it
-
- CodeLite Enthusiast
- Posts: 41
- Joined: Mon May 22, 2017 12:06 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Format current sourcode: operable program or batch file
hptphuong:
Open a command prompt (cmd) and paste the following in it:
Hit enter and copy-pate the result to the forum so we can see it.
Open a command prompt (cmd) and paste the following in it:
Code: Select all
C:\Windows\system32\cmd.exe /C "C:\Program Files\CodeLite\codelite-clang-format.exe" -assume-filename=main_app.cpp -style="{ BasedOnStyle: WebKit, IndentWidth: 4, UseTab: ForIndentation, 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 : true, IndentFunctionDeclarationAfterType : true, SpaceBeforeAssignmentOperators : true, SpaceBeforeParens : Never, SpacesInParentheses : false, BreakBeforeBraces : Linux, ColumnLimit : 120, PointerAlignment : Left }" -cursor=0 -offset=0 -length=508 "C:\Users\hptphuong\Documents\Self C++\learning\first\.code-formatter-tmp.cpp"
- eranif
- CodeLite Plugin
- Posts: 6375
- Joined: Wed Feb 06, 2008 9:29 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Format current sourcode: operable program or batch file
One thing to note here:
change the filename from: .code-formatter-tmp.cpp to the actual filename you want to format
change the filename from: .code-formatter-tmp.cpp to the actual filename you want to format
Make sure you have read the HOW TO POST thread