Ziv
Ziv

Reputation: 2785

CLion formatter breaks MOCK_METHOD lines

I am using gmock in CLion, whenever I format my file, all the MOCK_METHOD macros are broken up with unnecessary line breaks. like this:

Before:

    class MockObservableExecutor : public IObservableExecutor {
        MOCK_METHOD1(registerExecutor, void(IObserverExecutor*));
        MOCK_METHOD2(sendMessage, void(const std::string&, const std::string&));
    };

After:

    class MockObservableExecutor : public IObservableExecutor {
        MOCK_METHOD1(registerExecutor, void(IObserverExecutor
                *));

        MOCK_METHOD2(sendMessage, void(
                const std::string&, const std::string&));
    };

I see no reason that the single asterisk should get a line of its own, how can I tell CLion to stop its shenanigans? Why does it decide that it should break the line there?

For now I have added //@formatter:off and //@formatter:on statemenst around my mock but I do want formatting to work for some of the stuff in my mock.

Upvotes: 1

Views: 169

Answers (1)

uta
uta

Reputation: 2069

That is a bug: CPP-18644 It will be fixed in the next EAP/fix-release. Sorry.

Upvotes: 1

Related Questions