Zeus C/C++ Auto-complete Using Clang

Find Tips and tricks on how to better use the Zeus editor. Feel free to post your own tips but please do not post bug reports, feature requests or questions here.
jussij
Site Admin
Posts: 2446
Joined: Fri Aug 13, 2004 5:10 pm

Zeus C/C++ Auto-complete Using Clang

Postby jussij » Sun Nov 29, 2015 1:33 am

The latest Zeus beta release adds C/C++ autocomplete, code navigation and code reformatting by using Clang.

The latest beta can be found here: http://www.zeusedit.com/z300/zeus-beta.zip

Auto-completion
Consider this example of code:

Code: Select all

class Person {
public:
    const int   age()  { return 26; }
    const char *fist() { return "John"; }
    const char *last() { return "Smith"; }
}

void Test() {
    Person person;
    person.|
}

With an autocomplete trigger at the cursor location show will result in the auto-completion shown below:

clang_complete.png
clang_complete.png (7.09 KiB) Viewed 866 times

Code Formatting
The beta also includes a macro that will re-format a marked region of code using the clang-format utility.

As an example consider code that looks like this:

Code: Select all

class Person {
  public:
      const int     age()  {
        return 26; }
      const char *fist()
      {
        return "John"; }
        const char *last() {
            return "Smith"; }
}

By marking that region of code and running the macro will result in that code being reformatted as shown below:

Code: Select all

class Person {
public:
    const int age() { return 26; }
    const char *fist() { return "John"; }
    const char *last() { return "Smith"; }
}

Code Navigation
The Zeus beta also includes a macro that provides Clang driven code navigation.

Cheers Jussi

Return to “Tutorials, Tips and Tricks”

Who is online

Users browsing this forum: No registered users and 3 guests