I’m not sure I would recommend even trying to hide stuff in source edit mode, as it would easily lead to confusion as to where stuff was defined, and how would you get to these hidden pieces?
An alternative solution, could be to move the actual definition of the tasks into a different file, and use a dataview query in the original file to show non-completed task. This would also allow for automatic tagging of the task when completed. Downside, you would need to open the other file to change the tasks.
Similar to the previous solution, you could possibly use the Tasks plugin to show the non-completed tasks, and I believe it has some sort of support for editing the tasks in its views, so you wouldn’t need to open the other file for task changes. Not sure if you can add tasks that way, or not.
Yet another solution, which is not source mode editing, but rather live preview editing, would be as you might elude to use either CSS to hide completed tasks, or to encompass your tasks in auto-collapsed callouts (which would hide all tasks until un-collapsed).
A final idea, would be not to hide, but to change the text color of the completed tasks using a plugin such as Dynamic Highlights, if you import the following CSS into it:
"CompletedTask": {
"class": "CompletedTask",
"color": "#00000000",
"regex": true,
"query": "^\\s*[-*+]\\s+\\[x\\].*$",
"mark": [
"match",
"line"
],
"css": ".theme-dark .CompletedTask {\n color: #222222 !important;\n}\n\n.theme-light .CompletedTask {\n color: #dddddd !important;\n}"
}
You could get output like the following:

By changing the #111111
, you can change the color to be as dark as you want, but still viable if you need to change it sometime.