I realise this posting is from 28.Feb.2023, and it's now Dec.2024. But since zero replies has been made, I'll take a stab at it anyway.
As to GSheets, and getting
custom functions to auto-complete towards end-users in the GSheet GUI, then:
Your custom functions MUST reside in the global space, i.e. there'll be no wrapping of said function into namespace, or making them nested functions.
And your custom functions (obviously) also need to be equipped with appropriate JSDocs comments, e.g.:
Example:
/**
* Gets the GDrive FileName of this GSheet-file,
* @returns {string} The GDrive FileName of this GSheet-file,
* @customfunction
*/
function custFileName() {
return SpreadsheetApp.getActiveSpreadsheet().getName();
}
Well, that's how I see it, after having spent an uncomfortable amount of time, attempting to avoid cluttering up the global scope.