Well, that code is pretty hacky for the moment, and I guess it shouldn't use `get_scope_members` at all but instead just use the scope parameter to `tm_workspace_find()` -- though sadly `tm_wokspace_find_prefix()` doesn't have it, but it's fairly easy to fix -- and I believe your proposed PR does it anyway, with or without the extra query API.
Not saying your module wouldn't help, but that the code here is likely to be easily improved a lot in any case. I hacked that very carelessly just as a proof of concept.