Thanks for the detailed report. This has now been fixed for the next release: https://feedback.objo.dev/bug/896
There were two separate problems involved.
First, the parameters field was accepting malformed text such as "fragment 3" and inserting it into the method declaration. When the compiler encountered that declaration, its error recovery lost track of the method boundary and consequently treated lines from the method body as module members. That caused the repeated and misleading “Expected module member declaration” errors.
The parameters field is now validated using the compiler’s own parameter grammar. Invalid text remains in the field so it can be corrected, but it is not written into the project. Studio displays the error beside the field and also shows an error indicator in the method header when the metadata panel is collapsed.
The resulting message for this example now explains that parameter names cannot contain spaces and that parameters must be separated with commas.
I 've also improved compiler recovery. If a malformed method declaration is encountered in existing source, the compiler now skips to the matching End Sub, End Function, or equivalent terminator instead of reporting errors against each line of the body.
Finally, method metadata edits now trigger the same live-diagnostics refresh as code edits. Correcting the parameters field therefore removes the old errors and gutter markers immediately, without requiring Analyse or an extra click in the editor.
Thanks again. The reproduction details made all three parts of the problem straightforward to identify.