Sublime Forum

Goto symbol Python type annotations - missing return type

#1

Currently if you have type annotations in your Python code and use the Goto symbol shortcut, you will only see the type annotations for the arguments but not the return type ie.

def set_mode(self, mode: PaymentMode) -> bool:

will be shown in the Goto symbol menu as:

set_mode(self, mode: PaymentMode)

and it could be extended to also include the return type

set_mode(self, mode: PaymentMode) -> bool
0 Likes

#2
def set_mode(self, mode: PaymentMode) -> bool:

shows as set_mode(…) for me in the symbol list.

0 Likes

#3

I am using version 3.2.2 , build 3211 on Linux

0 Likes

#4

You must be using a third-party package, then, because the default symbol preferences for Python are as follows:

0 Likes

#5

Ah, I probably am even though I didn’t install it for that specific purpose. My bad, disregard this post… Or expand it anyways? ¯_(ツ)_/¯

0 Likes

#6

The current situation is that the function signature is condensed, so the symbol list doesn’t become too messy with many parameters. I like that, personally, because the function’s name is the most significant thing for me and signature comes secondary at best.

0 Likes

#7

I like to use the Goto symbol as a quick reference, but you have a point that it could be messy.
Maybe this suggestion shouldn’t be directed at the base sublime text, rather the package I’m using.
Feel free to close this thread.

Although, if you know of a way to determine what package overrides this, I would be grateful.

0 Likes