Author Topic: ClangFormat wrapper plugin  (Read 3224 times)

Offline andrej]

  • Single posting newcomer
  • *
  • Posts: 3
  • embedded systems enthusiast
    • lastfm
ClangFormat wrapper plugin
« on: November 30, 2014, 01:56:22 pm »
I'm trying to write a clang-format wrapper plugin and I can't find a way to build a plugin anyhow (win32 platform). All of the tutorials are outdated and none of them work (including http://wiki.codeblocks.org/index.php?title=Compile_Code::Blocks_plugins_based_on_a_nightly). Can anyone post a quick step-by-step for plugin building? I'll extrapolate the rest from the existing plugins' sources.

Clang format is the superior code formatting tool for C/C++. I use it with Sublime Text 3 and it just kicks ass - it's way smarter and more capable than Astyle, with pretty much complete C++11 support. The inferface (a console utility with both file and stdin/out inputs and outputs; all options available via parameters) is absolutely perfect for writing it into a plugin.

I think many people would benefit from this (tbh, I'm doing this for my girlfriend, she's used to CB and doesn't wanna learn make + Sublime), so, PLEASE help me learn how to build a plugin.
people won't be people when they hear this sound...

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5214
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: ClangFormat wrapper plugin
« Reply #1 on: November 30, 2014, 02:05:21 pm »
I'm trying to write a clang-format wrapper plugin and I can't find a way to build a plugin anyhow (win32 platform). All of the tutorials are outdated and none of them work (including http://wiki.codeblocks.org/index.php?title=Compile_Code::Blocks_plugins_based_on_a_nightly). Can anyone post a quick step-by-step for plugin building? I'll extrapolate the rest from the existing plugins' sources.
I think you can read this: Builld C::B on Windows, which is more complete than Compile Code::Blocks plugins based on a nightly

Once you can build C::B and all it's plugins, you can simply copy one plugin source and make your own plugin.

EDIT:
we have many core plugins and contributed plugins in C::B trunk, so learn how to build a simple plugin is not that hard.
« Last Edit: November 30, 2014, 02:06:59 pm by ollydbg »
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline andrej]

  • Single posting newcomer
  • *
  • Posts: 3
  • embedded systems enthusiast
    • lastfm
Re: ClangFormat wrapper plugin
« Reply #2 on: November 30, 2014, 02:30:04 pm »
thank you! that'll get me going!
people won't be people when they hear this sound...