AL icon indicating copy to clipboard operation
AL copied to clipboard

Internal functions are visible in VSCode

Open AndriusAndrulevicius opened this issue 9 years ago • 5 comments

It is possible to see internal functions from objects are accessible: codeunit 74999999 MyCodeunit { var Item : Record Item; GenJnlPostLine : Codeunit "Gen. Jnl.-Post Line"; trigger OnRun(); var Item2 : Record Item; GenJnlPostLine2 : Codeunit "Gen. Jnl.-Post Line"; begin Item.GetItemNo('AA'); Item2.GetItemNo('AA'); GenJnlPostLine.RunWithoutCheck(); GenJnlPostLine2.RunWithoutCheck(); end; } Both GetItemNo in Item table and RunWithoutCheck in codeunit "Gen. Jnl.-Post Line" are marked as internal.

AndriusAndrulevicius avatar Aug 11 '17 07:08 AndriusAndrulevicius

This is by design. We believe it is better to show that they exists and prevent usage with an error instead of hiding them entirely.

esbenk avatar Aug 11 '17 07:08 esbenk

maybe then they should have [internal] before the name of the function? I personally don't really see the benefit of showing the function that can't be used.

AndriusAndrulevicius avatar Aug 11 '17 07:08 AndriusAndrulevicius

It is a good suggestion to try to differentiate between the different types in intellisense. We will investigate our options there.

Since we may have been overly restrictive when initially marking functions as internal, we are opening up for more functions on request after manuel validation. In order to be able to let developers discover internal functions we have chosen to let them show up.

esbenk avatar Aug 11 '17 07:08 esbenk

Any update on this? I also find it very confusing that the intellisense drilldown shows internal functions even if target=extension has been added to the app.json, and that you can't distinguish them from the external ones that are really available to be used.

Kowa63 avatar Apr 12 '18 13:04 Kowa63

This doesn't seem to be an issue anymore. Neither internal nor local procedures are shown in the intellisense auto-complete popup when typing SomeCodeunit.SomeFunctionName. So unless I missed some detail about where these are showing, it seems this issue is obsolete.

dzzzb avatar Feb 24 '21 14:02 dzzzb