al-code-outline
al-code-outline copied to clipboard
Sort procedures, Sort permissions, ... fails when the #pragma warning directive is used in the code
Hi @anzwdev,
Something me and my colleague noticed. The sorting commands do not work if #pragma warning ... is used in the code.
If you comment out or remove the lines, then the sorting commands work again.
Hi @rvanbekkum
Yes, I designed it this way. If there are no directives inside sorted area of code (i.e. between variable declarations inside var section), whole section of code will be sorted. If there are #region and #endregion directives, syntax nodes inside these regions will be sorted separately. If there are any other directives, sorting is currently disabled to avoid situation when directive covers different lines of code than before running the command.
Hi @anzwdev, I fully understand your motive but unfortunelately the result is really undesirable. Sorting won't work anymore for all objects where #pragma directives are used. An additional setting like "Ignore #pragma directives on sorting" would really help me/us!
It is quite common in our AppSource apps that we have one or more objects that is obsoleted, and still have those in our Permission Sets we are adding pragmas for AL0432 around that object - and this is killing the sort permissions feature for all our AppSource apps. :(
Maybe it's possible to solve that particular use case?