Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return types in C++ #22

Closed
Shatur opened this issue Nov 8, 2021 · 11 comments
Closed

Return types in C++ #22

Shatur opened this issue Nov 8, 2021 · 11 comments
Labels
bug Something isn't working

Comments

@Shatur
Copy link
Contributor

Shatur commented Nov 8, 2021

Issue description

Currently the plugin generates @returns for return_statement. But sometimes it doesn't work.

Examples

No return type:

    /**
     * @brief Cancel translation operation (if any).
     */
    void abort();

Return type present.

    /**
     * @brief Check translation progress
     *
     * @return `true` when the translation is still processing and has not finished or was aborted yet.
     */
    bool isRunning() const;

Additional notes

Doxygen understands @return and @returns. But I would suggest to go with @return, since @returns is just an alias to @return.

@danymat danymat added the enhancement New feature or request label Nov 8, 2021
danymat added a commit that referenced this issue Nov 10, 2021
@danymat
Copy link
Owner

danymat commented Nov 10, 2021

@Shatur Can you try updating the plugin and checking out ?

@Shatur
Copy link
Contributor Author

Shatur commented Nov 11, 2021

I think you get me wrong. We shouldn't have @return for void and should have it in all other cases.

@Shatur
Copy link
Contributor Author

Shatur commented Nov 11, 2021

Examples:

Instead of:

    /**
     * @brief 
     *
     * @return 
     */
    void test();

We should have:

    /**
     * @brief 
     */
    void test();

@danymat
Copy link
Owner

danymat commented Nov 11, 2021

I don't quite get it:

  • you don't want return when the return type is void ? (It was previously implemented though)
  • what else ?

@Shatur
Copy link
Contributor Author

Shatur commented Nov 11, 2021

you don't want return when the return type is void ? (It was previously implemented though)

Yes.
But it need it for all other return types (didn't worked before), but works now.

@danymat
Copy link
Owner

danymat commented Nov 11, 2021

Okay so I just apply those changes ? #22 (comment)

@Shatur
Copy link
Contributor Author

Shatur commented Nov 11, 2021

Yes, I think so :)

@danymat
Copy link
Owner

danymat commented Nov 11, 2021

@Shatur Can you test the last changes ?

@Shatur
Copy link
Contributor Author

Shatur commented Nov 11, 2021

It works, but now only for primitive types.
For example, this works as expected:

    /**
     * @brief Check translation progress
     *
     * @return `true` when the translation is still processing and has not finished or was aborted yet.
     */
    bool isRunning() const;

But this doesn't:

    /**
     * @brief 
     */
    QToolButton swapButton();

Should be like this:

    /**
     * @brief 
     *
     * @return 
     */
    QToolButton swapButton();

@danymat
Copy link
Owner

danymat commented Nov 13, 2021

Hello @Shatur, can you try the fix provided ?

@danymat danymat added bug Something isn't working and removed enhancement New feature or request labels Nov 13, 2021
@Shatur
Copy link
Contributor Author

Shatur commented Nov 13, 2021

Now everything is awesome, thank you!

@Shatur Shatur closed this as completed Nov 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants