Show overoaded functions in intelli

SyntaxEditor Python Language Add-on for WPF Forum

Posted 2 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 2 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.1) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.