rubberduck-vba / Rubberduck

Every programmer needs a rubberduck. COM add-in for the VBA & VB6 IDE (VBE).
https://rubberduckvba.com
GNU General Public License v3.0
1.92k stars 302 forks source link

Replace Exit Sub when converting Subs to Functions #6171

Closed MDoerner closed 1 year ago

MDoerner commented 1 year ago

Closes #6139

This PR makes the quick fix assign the return value and then exit the function instead of exiting the procedure that gets converted. These two statements are inserted separated by a statement separator instead of doing it on multiple lines to avoid having a separate code path if the Exit Sub is in a single line if statement.

rubberduck-vba-releasebot commented 1 year ago

:white_check_mark: Build Rubberduck 2.5.9.6301 completed (commit https://github.com/rubberduck-vba/Rubberduck/commit/7d29b47459 by @MDoerner)

codecov[bot] commented 1 year ago

Codecov Report

Merging #6171 (6cf1536) into next (877d0f6) will not change coverage. The diff coverage is n/a.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## next #6171 +/- ## ======================================= Coverage 97.58% 97.58% ======================================= Files 4 4 Lines 413 413 Branches 28 28 ======================================= Hits 403 403 Misses 6 6 Partials 4 4 ```