New Plugin: Code Beautifier
-
- CodeLite Enthusiast
- Posts: 34
- Joined: Fri Sep 14, 2012 1:01 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
New Plugin: Code Beautifier
This code formatter, based on "Uncrustify Code Beautifier", support C++11.
Correct formatting lambdas, empty initialiling block (list "new Rect({}, {})"), others. Has more than 350 settings.
Correct formatting lambdas, empty initialiling block (list "new Rect({}, {})"), others. Has more than 350 settings.
You do not have the required permissions to view the files attached to this post.
-
- CodeLite Enthusiast
- Posts: 34
- Joined: Fri Sep 14, 2012 1:01 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: New Plugin: Code Beautifier
Hot fixes
You do not have the required permissions to view the files attached to this post.
- eranif
- CodeLite Plugin
- Posts: 6375
- Joined: Wed Feb 06, 2008 9:29 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: New Plugin: Code Beautifier
Thanks for sharing this plugin.
I see that it does not support CMake build for codelite on Mac / Linux..
I will look at it tomorrow and will update the proper files
Thanks,
Eran
I see that it does not support CMake build for codelite on Mac / Linux..
I will look at it tomorrow and will update the proper files
Thanks,
Eran
Make sure you have read the HOW TO POST thread
- eranif
- CodeLite Plugin
- Posts: 6375
- Joined: Wed Feb 06, 2008 9:29 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: New Plugin: Code Beautifier
Hi NilC,
I finally got the time to have a look at this plugin.
I compiled it under Windows (had to tweak the patch a bit) and it runs
However, the first file I tried to indent - the output was less than desire...
here is the source code I tried to indent:
and here is how it looks after I "beautified" it:
Everything moved to the left (I think its because I have function definitions in the header file)
Maybe you can give me some hint on which settings I should tweak in the (very long) uncrustify.cfg file?
For now, I am going to add the sources to git - but they won't be compiled with codelite (this is so I can work on them on different machines)
General comments:
- I think that the plugin should honor the editor settings (e.g. in the "Global Editor Preferences -> Indent" I have use spaces for idnenting, this should be honored by the plugin as well)
- Maybe providing a UI for the configuration file with the most common flags ( I can do this )
- The configuration file should go to 'config' folder
- Keyboard shortcut
- Allow indenting selection only
Thats it for now,
Eran
I finally got the time to have a look at this plugin.
I compiled it under Windows (had to tweak the patch a bit) and it runs
However, the first file I tried to indent - the output was less than desire...
here is the source code I tried to indent:
Code: Select all
#include <wx/app.h>
#include <wx/event.h>
#include "MainFrame.h"
#include <wx/image.h>
// Define the MainApp
class MainApp : public wxApp
{
public:
MainApp() {}
virtual ~MainApp() {}
virtual bool OnInit() {
// Add the common image handlers
wxImage::AddHandler( new wxPNGHandler );
wxImage::AddHandler( new wxJPEGHandler );
wxImage::AddHandler( new wxGIFHandler );
MainFrame *mainFrame = new MainFrame(NULL);
SetTopWindow(mainFrame);
return GetTopWindow()->Show();
}
};
DECLARE_APP(MainApp)
IMPLEMENT_APP(MainApp)
Code: Select all
#include <wx/app.h>
#include <wx/event.h>
#include "MainFrame.h"
#include <wx/image.h>
// Define the MainApp
class MainApp : public wxApp
{
public:
MainApp() {
}
virtual ~MainApp() {
}
virtual bool OnInit() {
// Add the common image handlers
wxImage::AddHandler( new wxPNGHandler );
wxImage::AddHandler( new wxJPEGHandler );
wxImage::AddHandler( new wxGIFHandler );
MainFrame * mainFrame = new MainFrame(NULL);
SetTopWindow(mainFrame);
return GetTopWindow()->Show();
}
};
DECLARE_APP(MainApp)
IMPLEMENT_APP(MainApp)
Maybe you can give me some hint on which settings I should tweak in the (very long) uncrustify.cfg file?
For now, I am going to add the sources to git - but they won't be compiled with codelite (this is so I can work on them on different machines)
General comments:
- I think that the plugin should honor the editor settings (e.g. in the "Global Editor Preferences -> Indent" I have use spaces for idnenting, this should be honored by the plugin as well)
- Maybe providing a UI for the configuration file with the most common flags ( I can do this )
- The configuration file should go to 'config' folder
- Keyboard shortcut
- Allow indenting selection only
Thats it for now,
Eran
Make sure you have read the HOW TO POST thread
-
- CodeLite Enthusiast
- Posts: 34
- Joined: Fri Sep 14, 2012 1:01 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: New Plugin: Code Beautifier
Try
Code: Select all
indent_class = true
indent_col1_comment = true //this one for comments
-
- CodeLite Enthusiast
- Posts: 34
- Joined: Fri Sep 14, 2012 1:01 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: New Plugin: Code Beautifier
Agree. I'll work on 1, 3 and 4 points when I'll get free time. Also need to think about formatting after "Implements All Un-implemented Functions" command.- I think that the plugin should honor the editor settings (e.g. in the "Global Editor Preferences -> Indent" I have use spaces for idnenting, this should be honored by the plugin as well)
- Maybe providing a UI for the configuration file with the most common flags ( I can do this )
- The configuration file should go to 'config' folder
- Keyboard shortcut
Hmm, it should works already. Uncrustify Code Beautifier use just whole file, so i'm using uncrustify.buffer file for copy just selection. Don't forget about settings, which I posted early.- Allow indenting selection only
Last edited by NilC on Tue Jul 09, 2013 6:39 pm, edited 4 times in total.
-
- CodeLite Enthusiast
- Posts: 34
- Joined: Fri Sep 14, 2012 1:01 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: New Plugin: Code Beautifier
Also, here my config
You do not have the required permissions to view the files attached to this post.
-
- CodeLite Enthusiast
- Posts: 34
- Joined: Fri Sep 14, 2012 1:01 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: New Plugin: Code Beautifier
Improvement patch. New version of Code Beautifier
You do not have the required permissions to view the files attached to this post.
-
- CodeLite Enthusiast
- Posts: 34
- Joined: Fri Sep 14, 2012 1:01 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: New Plugin: Code Beautifier
Another patch. Fixing arguments.
You do not have the required permissions to view the files attached to this post.