[IGN-3987]Designer - Scripting function list breaks when using type comments

Hello, IA.

Recently, as we’ve started using type hints for our internal APIs, we’ve noticed that the navigation on the right breaks when we’re using type hints on each function argument rather than having them as a single type comment.

Taking the example from mypy’s Python 2 cheat sheet, we see that the send_email function is not listed.

def send_email(address,     # type: Union[str, List[str]]
               sender,      # type: str
               cc,          # type: Optional[List[str]]
               bcc,         # type: Optional[List[str]]
               subject='',
               body=None    # type: List[str]
               ):
    # type: (...) -> bool
    system.net.sendEmail("localhost:25", "no-reply@domain.com", "Subject", body, True, address)

See here:


Fig. 1

Compared to the following, where the arguments don’t have the type comment:


Fig. 2

I would expect to see all functions listed as in Fig. 2 when using type comments as in Fig. 1.

Thanks!

Yeah, this doesn’t totally surprise me. The current function panel is a fairly naive regex-based implementation, rather than a proper parsing approach. It’s on the list to revamp in a number of ways (e.g. sorting, expand/collapse all).

Open to any other fun ideas for functionality here, as well :slight_smile:

1 Like

Should this be a bug or an idea?

I don’t think an ideas post is necessary; it’s already something we’re tracking and plan to do. It’d have to get quite a few upvotes to ‘upgrade’ to the next level of prioritization.

1 Like