I am not really sure if this is a bug, but I wouldn't expect this behaviour.
I noticed functions and classes defined inside a comment appear in the list to the right of the scripting window.
I have seen this issue in Ignition 8.1.18 and in Ingition Edge 8.1.32
The current parsing that populates that sidebar is just some fairly naive regex based parsing that's very easy to break. It's long been on my list to replace it with a proper AST based parse, like what populates the actual autocomplete, but it hasn't risen to the top of the pile.
I'm hoping to tackle it as part of a suite of scripting related improvements in 8.3.0.