6.2.5. Dotted Name CompletionΒΆ

Any identifier that immediately follows a dot can be completed by Code Assist, particularly entities declared within packages and within record objects. For example, if you type “with Ada.” the smart completion window will appear automatically, listing all the child and nested packages of Ada. You can also write the beginning of the package, e.g.: entering “with Ada.Text” and pressing the Code Assist key will offer you “Text_IO”.

In the following figure, we invoke Code Assist after entering the name of the package MS1553. The completion window then proposes candidates consisting of the entities declared within the package as well as child packages rooted at MS1553. Note the icons indicating the kinds of entity proposed. In this case types and child packages are depicted:

smart completion after a package name

Code Assist is proposing the components of a record object in the following figure. Here, the object WOW is of type type Discrete, a record type containing the four components indicated in the smart completion window:

smart completion of a record object

Code Assist can handle derived record types too, and will include in the smart completion window all inherited record components that are visible at the point of the invocation.

smart completion of a record object with inherited components

In keeping with the Ada visibility rules, components of private types are not proposed if they are not visible. In this next figure we declare type Discrete as a private extension so outside the package the components are not visible (except to child units):

smart completion decl of a private extension

Then, when we invoke Code Assist outside the package, only the visible components are proposed:

smart completion of a record object with private inherited components