Skip to content

Commit 4584458

Browse files
Merge pull request #93 from codefori/docs/cl-enhancements
Document CL v1.2.0 enhancements
2 parents ee2c5ed + eba2381 commit 4584458

10 files changed

Lines changed: 183 additions & 123 deletions

File tree

src/assets/clle/commandHover.png

367 KB
Loading
210 KB
Loading
546 KB
Loading

src/assets/clle/goToReferences.png

198 KB
Loading

src/assets/clle/outlineView.png

245 KB
Loading

src/assets/clle/parameterHover.png

167 KB
Loading

src/assets/clle/peakDefinition.png

120 KB
Loading

src/assets/clle/rename.png

115 KB
Loading

src/assets/clle/syntaxChecker.png

423 KB
Loading
Lines changed: 183 additions & 123 deletions
Original file line numberDiff line numberDiff line change
@@ -1,124 +1,184 @@
1-
---
2-
title: CLLE Language tools
3-
---
4-
5-
import { CardGrid, Card, Tabs, TabItem } from '@astrojs/starlight/components';
6-
import { Aside, Icon } from '@astrojs/starlight/components';
7-
8-
__Command Language__ is the scripting language for the IBM i operating system. This extension assists in CLP or CLLE program development, providing:
9-
10-
- Content assist for CL commands
11-
- Outline view
12-
- Go to or peek definition and references
13-
14-
It also provides support for running a CL statement with `Ctrl+r`.
15-
16-
## Installation
17-
18-
The CL Language tools extension can be [installed from the Marketplace](https://marketplace.visualstudio.com/items?itemName=IBM.vscode-clle)<Icon name="external" color="cyan" class="icon-inline" /> and is also part of the [IBM i Development Pack](https://marketplace.visualstudio.com/items?itemName=HalcyonTechLtd.ibm-i-development-pack)<Icon name="external" color="cyan" class="icon-inline" />.
19-
<CardGrid>
20-
<Card>
21-
Or it can be installed from the Extension view inside Visual Code.
22-
</Card><Card>
23-
![Install CLLE](../../../../assets/clle/Install_CL.png)
24-
</Card>
25-
</CardGrid>
26-
## Content Assist
27-
28-
Suppose you want to create a data area with the CRTDTAARA command. Enter CRTDTAARA __follwed by a space__, then press _Ctrl+Space_ to invoke Content Assist to produce a pick list like this:
29-
30-
![Example step 2](../../../../assets/clle/ExCL_02.png)
31-
32-
<CardGrid><Card>
33-
34-
Press _Enter_ or _Tab_ to accept the highlighted _All parameters_ from the pick list and a skeleton command is created.
35-
36-
</Card><Card>
37-
38-
![Example step 3](../../../../assets/clle/ExCL_03.png)
39-
40-
</Card></CardGrid>
41-
42-
<CardGrid><Card>
43-
44-
Use`Ctrl+space` to get a pick list of special values or available variables (just one in this example):
45-
46-
</Card><Card>
47-
48-
![Example step 5](../../../../assets/clle/ExCL_05.png)
49-
50-
</Card></CardGrid>
51-
52-
### Content Assist Snippets
53-
54-
Prompting of most CL commands requires a connection to a server. However, there are a number of commands that are provided as snippets, which don't require a connection. `DCL`, for example, is provided as a snippet.
55-
56-
<CardGrid><Card>
57-
58-
To declare a variable, enter just `d` and get a list of commands that begin with `d`:
59-
60-
</Card><Card>
61-
62-
![Command assist](../../../../assets/clle/assist_01.png)
63-
64-
</Card></CardGrid>
65-
66-
<CardGrid><Card>
67-
68-
Since the `DCL` command is highlighted, hit enter and get a pick list of available parameters:
69-
70-
</Card><Card>
71-
72-
![Command assist all keywords](../../../../assets/clle/assist_02.png)
73-
74-
</Card></CardGrid>
75-
76-
<CardGrid><Card>
77-
78-
The `VAR` parameter value is selected, so enter the variable name, then tab to the `TYPE` parameter value:
79-
80-
</Card><Card>
81-
82-
![Command assist parameter](../../../../assets/clle/assist_03.png)
83-
84-
</Card></CardGrid>
85-
86-
<CardGrid><Card>
87-
88-
If all the valid valued for `TYPE` are know, just enter a valid value, for example `*CHAR`. Or delete the highlighted value and key _Ctrl+Space_ to get a pick list of the valid values:
89-
90-
</Card><Card>
91-
92-
![Command assist parameter](../../../../assets/clle/assist_03.png)
93-
94-
</Card></CardGrid>
95-
96-
<CardGrid><Card>
97-
98-
If all the valid valued for `TYPE` are know, just enter a valid value, for example `*CHAR`. Or delete the highlighted value and key _Ctrl+Space_ to get a pick list of the valid values:
99-
100-
</Card><Card>
101-
102-
![Command assist parameter](../../../../assets/clle/assist_04.png)
103-
104-
</Card></CardGrid>
105-
106-
## CL Code Runner
107-
108-
A CL command may be executed by highlighting the command and pressing _Ctrl+R_.
109-
110-
### Code Runner Example
111-
112-
The two lines of the `CRTMSGF` command are highlighted:
113-
114-
![Run CL example 1](../../../../assets/clle/RunCL_01.png)
115-
116-
Press _Ctrl+R_ and success is reported:
117-
118-
![Run CL example 1](../../../../assets/clle/RunCL_02.png)
119-
120-
Click _Open output_ if you want more detail or if the command fails:
121-
122-
![Run CL example 1](../../../../assets/clle/RunCL_03.png)
123-
1+
---
2+
title: CLLE Language tools
3+
---
4+
5+
import { CardGrid, Card, Tabs, TabItem } from '@astrojs/starlight/components';
6+
import { Aside, Icon } from '@astrojs/starlight/components';
7+
8+
**Command Language** is the scripting language for the IBM i operating system. This extension assists in CLP or CLLE program development, providing:
9+
10+
* Content assist for CL commands and parameters
11+
* Outline view
12+
* Go to or peek definition and references
13+
* Rename variables
14+
* Hover support for CL commands and parameters
15+
* Syntax checking
16+
17+
It also provides support for running a CL statement with `Ctrl+r`.
18+
19+
## Installation
20+
21+
The CL Language tools extension can be [installed from the Marketplace](https://marketplace.visualstudio.com/items?itemName=IBM.vscode-clle)<Icon name="external" color="cyan" class="icon-inline" /> and is also part of the [IBM i Development Pack](https://marketplace.visualstudio.com/items?itemName=HalcyonTechLtd.ibm-i-development-pack)<Icon name="external" color="cyan" class="icon-inline" />.
22+
23+
<CardGrid>
24+
25+
<Card>
26+
27+
Or it can be installed from the Extension view inside Visual Code.
28+
29+
</Card><Card>
30+
31+
![Install CLLE](../../../../assets/clle/Install_CL.png)
32+
</Card>
33+
34+
</CardGrid>
35+
36+
## Content Assist
37+
38+
Suppose you want to create a data area with the CRTDTAARA command. Enter CRTDTAARA __follwed by a space__, then press _Ctrl+Space_ to invoke Content Assist to produce a pick list like this:
39+
40+
![Example step 2](../../../../assets/clle/ExCL_02.png)
41+
42+
<CardGrid><Card>
43+
44+
Press _Enter_ or _Tab_ to accept the highlighted _All parameters_ from the pick list and a skeleton command is created.
45+
46+
</Card><Card>
47+
48+
![Example step 3](../../../../assets/clle/ExCL_03.png)
49+
50+
</Card></CardGrid>
51+
52+
<CardGrid><Card>
53+
54+
Use`Ctrl+space` to get a pick list of special values or available variables (just one in this example):
55+
56+
</Card><Card>
57+
58+
![Example step 5](../../../../assets/clle/ExCL_05.png)
59+
60+
</Card></CardGrid>
61+
62+
### Content Assist Snippets
63+
64+
Prompting of most CL commands requires a connection to a server. However, there are a number of commands that are provided as snippets, which don't require a connection. `DCL`, for example, is provided as a snippet.
65+
66+
<CardGrid><Card>
67+
68+
To declare a variable, enter just `d` and get a list of commands that begin with `d`:
69+
70+
</Card><Card>
71+
72+
![Command assist](../../../../assets/clle/assist_01.png)
73+
74+
</Card></CardGrid>
75+
76+
<CardGrid><Card>
77+
78+
Since the `DCL` command is highlighted, hit enter and get a pick list of available parameters:
79+
80+
</Card><Card>
81+
82+
![Command assist all keywords](../../../../assets/clle/assist_02.png)
83+
84+
</Card></CardGrid>
85+
86+
<CardGrid><Card>
87+
88+
The `VAR` parameter value is selected, so enter the variable name, then tab to the `TYPE` parameter value:
89+
90+
</Card><Card>
91+
92+
![Command assist parameter](../../../../assets/clle/assist_03.png)
93+
94+
</Card></CardGrid>
95+
96+
<CardGrid><Card>
97+
98+
If all the valid valued for `TYPE` are know, just enter a valid value, for example `*CHAR`. Or delete the highlighted value and key _Ctrl+Space_ to get a pick list of the valid values:
99+
100+
</Card><Card>
101+
102+
![Command assist parameter](../../../../assets/clle/assist_03.png)
103+
104+
</Card></CardGrid>
105+
106+
<CardGrid><Card>
107+
108+
If all the valid valued for `TYPE` are know, just enter a valid value, for example `*CHAR`. Or delete the highlighted value and key _Ctrl+Space_ to get a pick list of the valid values:
109+
110+
</Card><Card>
111+
112+
![Command assist parameter](../../../../assets/clle/assist_04.png)
113+
114+
</Card></CardGrid>
115+
116+
## Outline View
117+
118+
In the **Outline** view, you can get an overview of all declared variables, files, and subroutines. You can click on the name of any item to jump to the definition.
119+
120+
![Outline view](../../../../assets/clle/outlineView.png)
121+
122+
## Peek Definition and References
123+
124+
In the editor, you can right-click on a variable or subroutine and use **Go to Definition** or **Go to References** to quickly jump to the definition or all references of the variable or subroutine.
125+
126+
![Go to References](../../../../assets/clle/goToReferences.png)
127+
128+
You can also use **Find All References** which will pop open the **References** view to show all references.
129+
130+
![Find All References](../../../../assets/clle/findAllReferences.png)
131+
132+
Lastly, you can use any of the options under the right-click **Peak** submenu to get an inline preview of definitions or references without having to leave the current line are working on.
133+
134+
![Peak Definition](../../../../assets/clle/peakDefinition.png)
135+
136+
## Rename
137+
138+
You can right-click a variable and select **Rename Symbol** (or use the `F2` shortcut) to rename the variable. This will pop open a mini text box for you to enter the new variable name. Once you have entered the new name, hit `Enter` to proceed with renaming all instances of that variable or hit `Ctrl+Enter` to get a refactoring preview which you can use to selectively rename specific instances.
139+
140+
![Rename](../../../../assets/clle/rename.png)
141+
142+
## Hover Support
143+
144+
When writing your CL programs, you can hover over a command to view a description of the commad from its documentation.
145+
146+
![Command Hover](../../../../assets/clle/commandHover.png)
147+
148+
This works on individual parameters and is espically useful when determining what are the allowed values for a parameter. Content assist for paramters will also include this same documentation.
149+
150+
![Paramter Hover](../../../../assets/clle/parameterHover.png)
151+
152+
To view the full documentation for a command, scroll to the bottom of the hover window and select the **View Full Documentation** link. This will pop open a panel right in VS Code with the full documentation for the command which includes details on the command, parameter usage, examples, and error messages.
153+
154+
![Full Documentation](../../../../assets/clle/fullDocumentation.png)
155+
156+
## Syntax Checker
157+
158+
As you write your CL programs, the syntax checker will highlight any syntax errors in your code. You can error or navigate to the **Problems** view to see the full details along with errors across all files.
159+
160+
<Aside type="tip">
161+
From the VS Code Settings, you can search for "CL Syntax Options" to change various settings including whether the syntax checker automatically when opening documents or when editing a line.
162+
</Aside>
163+
164+
![Syntax Checker](../../../../assets/clle/syntaxChecker.png)
165+
166+
## CL Code Runner
167+
168+
A CL command may be executed by highlighting the command and pressing _Ctrl+R_.
169+
170+
### Code Runner Example
171+
172+
The two lines of the `CRTMSGF` command are highlighted:
173+
174+
![Run CL example 1](../../../../assets/clle/RunCL_01.png)
175+
176+
Press _Ctrl+R_ and success is reported:
177+
178+
![Run CL example 1](../../../../assets/clle/RunCL_02.png)
179+
180+
Click _Open output_ if you want more detail or if the command fails:
181+
182+
![Run CL example 1](../../../../assets/clle/RunCL_03.png)
183+
124184
Not all CL commands may be executed.

0 commit comments

Comments
 (0)