The Welkin Suite Forum

Format Selection



Format Selection

  • Please log in to reply

#1
windows version welkinsuite

gtasker

    Posted 01 Nov 2019 and edited 07 Nov 2019

    Would it be possible to add FORMAT SELECTION as an option.  FORMAT CODE changes formatting on all lines of the current file, including ones I don't want reformatted in some circumstances (for preference/readability reasons).

    For example, my original code is:

    try
    {
       work = [SELECT 
                      Id,
                      Type__c,
                      Status__c,
                      AssignedTo__c,
                      AssignedDate__c,
                      DelayProcessingUntil__c
                 FROM Work__c
                WHERE (Type__c = 'Lock') 
                       AND ((Status__c = 'Unlocked')
                             OR ((Status__c = 'Locked')
                                  AND ((AssignedTo__c = :name)
                                        OR DelayProcessingUntil__c <= :dtCurrentTime))) 
                LIMIT 1 
                  FOR UPDATE];
    }
    catch (QueryException qe)
    {
       result.statusCode = '8';
       result.message = 'My Error Message';
       result.exceptionMessage = qe.getMessage();
       RestContext.response.responseBody = Blob.valueOf(result.ToJson());
       return;
    }

    Then gets formatted to this:

    try
    {
       work = [SELECT
                Id,
                Type__c,
                Status__c,
                AssignedTo__c,
                AssignedDate__c,
                DelayProcessingUntil__c
                FROM Work__c
                WHERE(Type__c = 'Lock')
                AND((Status__c = 'Unlocked')
                   OR((Status__c = 'Locked')
                      AND((AssignedTo__c = :name)
                            OR DelayProcessingUntil__c <= :dtCurrentTime)))
                LIMIT 1
                FOR UPDATE];
    }
    catch(QueryException qe)
    {
       result.statusCode = '8';
       result.message = 'My Error Message';
       result.exceptionMessage = qe.getMessage();
       RestContext.response.responseBody = Blob.valueOf(result.ToJson());
       return;
    }

    Visual Studio has this capability, so if it is just a matter of enabling it in TWS, that would be great.

    Or is there an editorconfig file that I can customize?



    2 replies to this topic

    #2

    gtasker

      Posted 01 Nov 2019

      Hmm, after posting, the code blocks get changed from monospaced font to proportional font, so my examples don't help much



      #3

      ihor.zhabolenko

        Posted 06 Nov 2019

        Hello George.


        Thank you for your feature request.


        I've added an appropriate ticket so that our team could consider what we can do for this.

        I'm not sure that we will have an ability to work on this request the nearest months, however, I'll keep you updated on our progress if we start to work on this.


        Best Regards,

        Ihor


        TWS Team





        Boost Your Productivity. Get Started Today

        Try Free Trial