Forum Discussion

poffin's avatar
poffin
Occasional Contributor
8 years ago
Solved

Python Variable Auto Completion

I have the same question as a previous poster: https://community.smartbear.com/t5/Desktop-Testing/Python-and-IDE-auto-complete/m-p/104937/highlight/true#M3717

 

I'm switching from a JavaScript project to a Python project and there's one feature that I really miss. 

 

 

var aLongVariableName = Sys.Process("chrome");
aLo

If I were to type this into a TestComplete javascript project the IDE would suggest the name of the variable before I finished typing it.

 

 

 

anotherLongVariableName = Sys.Process("chrome")
ano

If I were to write the above code in Python, I would not be offered the name of the previously defined variable. Does the python IDE just not have this functionality, or perhaps if I declare it a special way I could get my auto completion back?

 

  • Hi,

     

    Unfortunately, in TestComplete IDE auto-completion for python works only if variable was declared or imported on the top level of the module:

     

    from some_module import variable1
    
    variable2 = 222
    
    
    class A:
        def __init__(self):
            self.variable3 = 333
    
    
    def foo():
        variable4 = 444
    
    
    '''
    Auto completion will work only for variable1 and variable2
    '''

    You can create the feature request for this case.

2 Replies

  • baxatob's avatar
    baxatob
    Community Hero

    Hi,

     

    Unfortunately, in TestComplete IDE auto-completion for python works only if variable was declared or imported on the top level of the module:

     

    from some_module import variable1
    
    variable2 = 222
    
    
    class A:
        def __init__(self):
            self.variable3 = 333
    
    
    def foo():
        variable4 = 444
    
    
    '''
    Auto completion will work only for variable1 and variable2
    '''

    You can create the feature request for this case.

    • poffin's avatar
      poffin
      Occasional Contributor

      Thank you for the thorough reply!