I’ve just noticed something peculiar yesterday when uninstalling my own extension. I happened to have the Ruby Console open and the following message popped up:
Extension returned wrong type for method mark_as_uninstalled
I’ve checked the docs and couldn’t find anything. Any ideas on how to suppress that message?
(1) Did you override the mark_as_uninstalled() method in your extension instance ?
It is an internal housekeeping method that should never be called directly by extensions nor overridden.
BTW, The method always should return true as its single statement is:
@has_been_uninstalled = true
(2) What is the your value of $VERBOSE ? If set to true you will get many more warnings in the console.
The default value is false I believe. Extensions should only ever change this global var’s value temporarily.
Setting to nil will suppress all warnings.
But be warned, (pun intended,) some of the internal API warnings have no way to switch them off.
The "extensions.rb" file is located in %ProgramFiles%/SketchUp/SketchUp 2022/Tools can be opened manually and read. Do not change it as all the contents of the "Tools" subfolder have been signed as is.
You cannot prevent it. The decision to output it to IO is made in the SketchUp core.
And, as you say, it occurs for all extensions, so suppressing it for one and not all would do no real good.
I tested and the warning appears regardless of the value of $VERBOSE.
(Normally setting to nil suppresses all such warnings.)
A user will only see it if they happen to have the Console open whilst managing their extensions. Most will not.