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?