Skip to content

Commit 1ad9d8b

Browse files
Update per review comments
1 parent 1401338 commit 1ad9d8b

File tree

2 files changed

+59
-30
lines changed

2 files changed

+59
-30
lines changed

courses/ada_essentials/900_gnat_in_practice/01-file_naming_conventions.rst

Lines changed: 55 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6,60 +6,88 @@ File Naming Conventions
66
Default File Naming Conventions
77
---------------------------------
88

9-
.. container:: columns
9+
* GNAT compiler assumes one compilable entity per file
1010

11-
.. container:: column
11+
* Package specification, subprogram body, etc
12+
13+
* File names should match the name of the compilable entity
1214

13-
* GNAT compiler assumes one compilable entity per file
15+
* Replace **.** with **-**
1416

15-
* Package specification, subprogram body, etc
17+
* File extensions describe the usage
1618

17-
* Filenames should match the name of the compilable entity
19+
* **.ads** |rightarrow| Specification / Interface
20+
* **.adb** |rightarrow| Body / Implementation
1821

19-
* Replacing **.** with **-**
20-
* File extension is :filename:`.ads` for specifications and :filename:`.adb` for bodies
22+
---------------------------------
23+
Example Filenames with Contents
24+
---------------------------------
25+
26+
.. container:: columns
2127

2228
.. container:: column
2329

2430
.. container:: latex_environment tiny
2531

26-
:filename:`some_types.ads`
27-
2832
.. code:: Ada
2933
3034
package Some_Types is
3135
type One_T is new Integer;
3236
type Two_T is new Character;
33-
function Convert
34-
(Src : One_T)
35-
return Two_T;
37+
function Convert (Src : One_T)
38+
return Two_T;
3639
end Some_Types;
3740
38-
:color-white:`blank line`
41+
.. container:: column
42+
43+
.. container:: latex_environment tiny
44+
45+
*Package specification for* :ada:`Some_Types` *is in file* :filename:`some_types.ads`
3946

40-
:filename:`some_types.adb`
47+
.. container:: latex_environment tiny
48+
49+
:color-white:`blank line`
50+
51+
.. container:: columns
52+
53+
.. container:: column
54+
55+
.. container:: latex_environment tiny
4156

4257
.. code:: Ada
4358
4459
package body Some_Types is
45-
function Convert
46-
(Src : One_T)
47-
return Two_T is
48-
(Two_T'Val (Integer (Src)));
60+
function Convert (Src : One_T)
61+
return Two_T is
62+
(Two_T'Val (Integer (Src)));
4963
end Some_Types;
5064
51-
:color-white:`blank line`
65+
.. container:: column
66+
67+
.. container:: latex_environment tiny
68+
69+
*Package body for* :ada:`Some_Types` *is in file* :filename:`some_types.adb`
5270

53-
:filename:`some_types-child.adb`
71+
.. container:: latex_environment tiny
72+
73+
:color-white:`blank line`
74+
75+
.. container:: columns
76+
77+
.. container:: column
78+
79+
.. container:: latex_environment tiny
5480

5581
.. code:: Ada
5682
57-
function Some_Types.Child
58-
(Src : Two_T)
59-
return One_T is
60-
begin
61-
return One_T (Two_T'Pos (Src));
62-
end Some_Types.Child;
83+
function Some_Types.Child (Src : Two_T)
84+
return One_T;
85+
86+
.. container:: column
87+
88+
.. container:: latex_environment tiny
89+
90+
*Subprogram specification for function* :ada:`Child` *which is a child of* :ada:`Some_Types` *is in file* :filename:`some_types-child.ads`
6391

6492
---------------------------------------
6593
Converting to GNAT Naming Conventions
@@ -92,7 +120,7 @@ Using Other Naming Conventions
92120

93121
* Controlled via package :ada:`Naming` in project file
94122

95-
* Example: your source files use :filename:`.1.ada` for specs and :filename:`.2.ada` for bodies
123+
* **Example:** your source files use :filename:`.1.ada` for specs and :filename:`.2.ada` for bodies
96124

97125
.. code:: Ada
98126

courses/ada_essentials/900_gnat_in_practice/02-vs_code.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@ Using VS Code with GNAT
66
Setting up VS Code
77
--------------------
88

9+
910
* Need to download and install *Ada & SPARK extensions for VS Code*
1011

11-
* https://marketplace.visualstudio.com/items?itemName=AdaCore.ada
12+
* :url:`Visual Studio Marketplace <https://marketplace.visualstudio.com/items?itemName=AdaCore.ada>`
1213
* Search for **adacore** in VS Code Extensions (:menu:`Ctrl+Shift+X`)
1314

1415
* Make sure GNAT is installed and on your path
1516

16-
* If not already downloaded, look here https://github.com/AdaCore/ada_language_server/tree/master/integration/vscode/ada#getting-additional-tools
17+
* If not already downloaded, look on :url:`GitHub <https://github.com/AdaCore/ada_language_server/tree/master/integration/vscode/ada\#getting-additional-tools>`
1718

1819
-----------------------------
1920
Using VS Code with the Labs
@@ -23,7 +24,7 @@ Using VS Code with the Labs
2324

2425
* From a command prompt
2526

26-
* Navigate the the appropriate folder (:filename:`prompt` or :filename:`answer`)
27+
* Navigate to the appropriate folder (:filename:`prompt` or :filename:`answer`)
2728
* Enter :command:`code .`
2829

2930
* :menu:`Explorer` tree should show :filename:`default.gpr` and Ada file(s)

0 commit comments

Comments
 (0)