Page 2 of 2

Re: Format current sourcode: operable program or batch file

Posted: Thu Jun 01, 2017 9:40 am
by hptphuong
Ok, It works with command line.

But how do i use it in codelite UI?

Could i need to pre-intall application or plugin more.

May be i miss some thing?

Re: Format current sourcode: operable program or batch file

Posted: Thu Jun 01, 2017 2:37 pm
by AJenbo
That command is what codelite uses internally, we need you to copy the resulting text from the command prompt so that we can try and figure out why it isn't working from within codelite on your system.

Re: Format current sourcode: operable program or batch file

Posted: Fri Jun 02, 2017 3:15 pm
by hptphuong

Code: Select all

hptphuong@DESKTOP-EQ6QH1B C:\Users\hptphuong
> 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\main_app.cpp"
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.

It gives the error.

But it's ok, if i run :

Code: Select all

hptphuong@DESKTOP-EQ6QH1B C:\Users\hptphuong
> "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\main_app.cpp"
{ "Cursor": 0, "IncompleteFormat": false }
#include "main_app.h"
#include "VanillaOption.h"
IMPLEMENT_APP_CONSOLE(MainApp)

MainApp::MainApp()
{
}

MainApp::~MainApp()
{
}

int MainApp::OnExit()
{
    return TRUE;
}

bool MainApp::OnInit()
{
    wxCmdLineParser parser(wxAppConsole::argc, wxAppConsole::argv);
    if(!DoParseCommandLine(parser)) {
        return false;
    }

    // place your initialization code here
    return true;
}

bool MainApp::DoParseCommandLine(wxCmdLineParser& parser)
{
    wxUnusedVar(parser);
    return true;
}

Re: Format current sourcode: operable program or batch file

Posted: Fri Jun 02, 2017 5:37 pm
by AJenbo
Please try the following:

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\main_app.cpp""