Show overoaded functions in intelli

SyntaxEditor Python Language Add-on for WPF Forum

Posted 7 months 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 7 months 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 (v22.1.3) was released 20 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.