Acuminator Outlining

Acuminator Dalek

Hello everyone!
This is a third post in the series describing Acuminator. It will be dedicated to the feature called outlining.

So, what does outlining mean? It’s an ability to collapse code parts unimportant to you at the moment in the code editor. I’m sure every .Net developer that uses Visual Studio or VS Code has seen this feature. You can collapse classes, methods and many other syntax structures. In C#, you can also add your own collapsible blocks with regions.

Acuminator Outlining

Now you may ask: “How is this feature related to Acumatica?”
There are many really big BQL queries in Acumatica code. Some of them do not even fit into one screen:

Example of a big BQL query
A big BQL query

Such BQL query can be a field in a class or it can be placed inside a method. It takes a lot of screen space, which is not so good for readability especially if you are reading a method with such query somewhere in the middle and you want to get a quick overview of the method’s logic.
The Acuminator outlining feature comes to the rescue. You can simply collapse the whole BQL like you collapse other code fragments:

Entirely collapsed BQL
Entirely collapsed BQL

Now you have an overview of all method’s logic that fits in one screen and is easy to understand. But there is more. You can collapse parts of the BQL query as well. For example, if you are interested in only one condition clause you can collapse all other parts. Now you can see only the part you want to see:

Partially collapsed BQL
Partially collapsed BQL

BQL One-liners

There is also an interesting use case when you work with Acumatica legacy code. Some BQL queries are written as one-liners and are not formatted at all. Here is an example:

BQL one-liner
BQL one-liner

This query does not fit into my screen width! However, I can easily collapse it. Now I can read parts interesting to me like Where or Aggregate parts.

BQL one-liner partially collapsed
BQL one-liner partially collapsed

Attributes Outlining

Another syntax construction outlined by Acuminator is a DAC attribute. Attributes are actively used in Acumatica and sometimes the attribute’s declaration is quite long. It can contain a BQL query or there are many parameters.

Example of long DAC attributes
Example of long DAC attributes

Here is the collapsed version:

Collapsed DAC attributes
Collapsed DAC attributes

Outlining Settings

The outlining feature has multiple options that can be configured in Acuminator settings (Tools -> Options -> Acuminator -> BQL Outlining).

BQL outlining options
BQL outlining options

The outlining can be disabled similar to all other Acuminator features. However, the outlining is built on top of the Acuminator syntax coloring feature. Therefore you can’t have both disabled syntax coloring and enabled outlining.
There are two modes for the BQL outlining. By default, the feature allows you to collapse the whole BQL query and its parts. But you can turn it off by setting the option “Outline parts of BQL commands” to false. Then the parts of the BQL query won’t be outlined and you will be able to collapse only the whole query.

Leave a Reply

Your email address will not be published. Required fields are marked *