Show overoaded functions in intelli

SyntaxEditor Python Language Add-on for WPF Forum

Posted 3 years ago by Tobias Lingemann - Software Devolpment Engineer, Vector Informatik GmbH
Avatar

Hi,

we have added support for overloaded functions in our editor, but the intelli prompt only shows the last signature. During runtime only the last signature can be called, but the useable parameters are defined by the overloads. The code would look like this:

from typing import overload

@overload
def MyTestCase():
  pass

@overload
def MyTestCase(a : int):
  pass

@overload
def MyTestCase(b : float):
  pass

def MyTestCase(*arg):
  if len(arg) == 0:
    # code for void parameter
    pass

  if len(arg) == 1:
    if isinstance(arg[0], int):
      # code for int parameter
      pass
    elif isinstance(arg[0], float):
      # code for float parameter
      pass


Best regards, Tobias Lingemann.

Comments (1)

Posted 3 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Tobias,

Thank you for the sample.  Unfortunately the resolver isn't currently able to return the overloads.  We will write down this request.  From researching it, it would require some large internal resolver infrastructure updates since we track results using dictionaries that have "name" keys, and all the overloads have the same name (e.g. MyTestCase) in this scenario.


Actipro Software Support

The latest build of this product (v24.1.3) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.