Forum Discussion

fayrehouse's avatar
fayrehouse
Frequent Contributor
12 years ago

Code Editor Feature Request/Suggestion

I might be the only one that thinks this is a good idea but...



I reckon it'd be nice if in the TC script editor, there was support for collapsing the code - ie, +/- boxes alongside the line numbers, matching for loops, if statements, even function blocks etc - so we could collapse and hide code to simplify the view - NOT having any impact on functionality etc, but for editing this could sometimes make life easier?



Anyone agree/disagree?
  • Hi Steve,

     


    Anyway, I have registered this request as a suggestion in our DB :)


     

  • karkadil's avatar
    karkadil
    Valued Contributor
    It is called Outlining and exists in TC ages (see attachment)
  • AlexKaras's avatar
    AlexKaras
    Champion Level 3
    Hi Steve,



    >  is there a way to get TC to automatically fold at different levels of code nesting? - eg for loops etc



    No. TestComplete can outline by definitions and manually selected areas only.

    Also note, that unlike, say, Visual Studio, that saves outlining information within the same source file, TestComplete stores outlining info in the local user project settings. This means that your outlining will be 'corrupted' if you edit the file outside TC IDE or (which is basically the same) if the file will be edited by someone else (while test suite is opened in the networked mode) and then reloaded by your TC instance.
  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)
    Hi Steve,

     


    Anyway, I have registered this request as a suggestion in our DB :)


     

  • fayrehouse's avatar
    fayrehouse
    Frequent Contributor
    Ok, I missed that ;)



    So I start outlining by "Hide by definitions" - but this seemingly only collapses entire functions, and multi-line comments. 



    I can select a block of code and manually hide that....

    But is there a way to get TC to automatically fold at different levels of code nesting? - eg for loops etc



    ??
  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi Steve,


     


    Automatic outlining works for functions (Outlining | Hide by Definitions). If you want to hide some code, you can use Outlining | Hide Selection.


    As far as I remember, VS works in a similar way.


     

  • fayrehouse's avatar
    fayrehouse
    Frequent Contributor
    Hi Tanya,



    I guess I was just hoping that the "definitions" could be modified to allow hiding (automatically) at multiple levels - eg fold if statement blocks within a function, aswell as the function itself etc



    No worries - even just folding functions is useful!