Sign in Join
Wiki copytemporary

Lazarus IDE Tools: what changed

Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
11The **[[Lazarus Faq|Lazarus]] IDE Tools** is a library of [[Free Pascal]] source parsing and editing tools, called the "codetools".
22
33These tools provide features like *Find Declaration*, *Code Completion*, *Extraction*, *Moving Inserting* and *Beautifying Pascal* sources. These functions can save a lot of time and duplicated work. They are customizable, and every feature is available via shortcuts (see Editor Options).
44
55Because they work solely on Pascal sources and understand FPC, [[Delphi]] and [[Kylix]] code, they do not require compiled units or an installed Borland/Embarcadero compiler. Delphi and FPC code can be edited at the same time, with several Delphi and FPC versions. This makes porting Delphi code to FPC/Lazarus much easier.
66
77## Summary Table of IDE shortcuts
88
99| | |
1010|----|----|
11-| [[Lazarus IDE Tools|Declaration Jumping]] | <span class="kbd">Ctrl</span>+Click or <span class="kbd">Alt</span>+<span class="kbd">Up</span> (jump to declaration of type or variable) |
12-| [[Lazarus IDE Tools|Method Jumping]] | <span class="kbd">Ctrl</span>+<span class="kbd">Shift</span>+<span class="kbd">Up</span> (toggle between definition and body) |
13-| [[Lazarus IDE Tools|Code Templates]] | <span class="kbd">Ctrl</span>+<span class="kbd">J</span> |
14-| [[Lazarus IDE Tools|Syncro Edit]] | <span class="kbd">Ctrl</span>+<span class="kbd">J</span> (while text is selected) |
15-| [[Lazarus IDE Tools|Code Completion]] (Class Completion) | <span class="kbd">Ctrl</span>+<span class="kbd">Shift</span>+<span class="kbd">C</span>, <span class="kbd">Ctrl</span>+<span class="kbd">Shift</span>+<span class="kbd">X</span> for creating class fields instead of local variables |
16-| [[Lazarus IDE Tools|Identifier Completion]] | <span class="kbd">Ctrl</span>+<span class="kbd">space</span> |
17-| [[Lazarus IDE Tools|Word Completion]] | <span class="kbd">Ctrl</span>+<span class="kbd">W</span> |
18-| [[Lazarus IDE Tools|Parameter Hints]] | <span class="kbd">Ctrl</span>+<span class="kbd">Shift</span>+<span class="kbd">space</span> |
19-| [[Lazarus IDE Tools|Incremental Search]] | <span class="kbd">Ctrl</span>+<span class="kbd">E</span> |
20-| [[Lazarus IDE Tools|Rename Identifier]] | <span class="kbd">Ctrl</span>+<span class="kbd">Shift</span>+<span class="kbd">E</span> |
11+| [[Lazarus IDE Tools|Declaration Jumping]] | `Ctrl`+Click or `Alt`+`Up` (jump to declaration of type or variable) |
12+| [[Lazarus IDE Tools|Method Jumping]] | `Ctrl`+`Shift`+`Up` (toggle between definition and body) |
13+| [[Lazarus IDE Tools|Code Templates]] | `Ctrl`+`J` |
14+| [[Lazarus IDE Tools|Syncro Edit]] | `Ctrl`+`J` (while text is selected) |
15+| [[Lazarus IDE Tools|Code Completion]] (Class Completion) | `Ctrl`+`Shift`+`C`, `Ctrl`+`Shift`+`X` for creating class fields instead of local variables |
16+| [[Lazarus IDE Tools|Identifier Completion]] | `Ctrl`+`space` |
17+| [[Lazarus IDE Tools|Word Completion]] | `Ctrl`+`W` |
18+| [[Lazarus IDE Tools|Parameter Hints]] | `Ctrl`+`Shift`+`space` |
19+| [[Lazarus IDE Tools|Incremental Search]] | `Ctrl`+`E` |
20+| [[Lazarus IDE Tools|Rename Identifier]] | `Ctrl`+`Shift`+`E` |
2121
2222## Method Jumping
2323
24-To jump between a procedure body (begin..end) and the procedure definition (procedure Name;) use <span class="kbd">Ctrl</span>+<span class="kbd">Shift</span>+<span class="kbd">Up</span>.
24+To jump between a procedure body (begin..end) and the procedure definition (procedure Name;) use `Ctrl`+`Shift`+`Up`.
2525
2626For example:
2727
2828``` pascal
2929interface
3030
3131procedure DoSomething; // procedure definition
3232
3333implementation
3434
3535procedure DoSomething; // procedure body
3636begin
3737end;
3838```
3939
40-If the cursor is on the procedure body and <span class="kbd">Ctrl</span>+<span class="kbd">Shift</span>+<span class="kbd">Up</span> is pressed, the cursor will jump to the definition. Pressing <span class="kbd">Ctrl</span>+<span class="kbd">Shift</span>+<span class="kbd">Up</span> again will jump to the body, after 'begin'.
40+If the cursor is on the procedure body and `Ctrl`+`Shift`+`Up` is pressed, the cursor will jump to the definition. Pressing `Ctrl`+`Shift`+`Up` again will jump to the body, after 'begin'.
4141
4242This works between methods (procedures in classes) as well.
4343
4444Hints: 'Method Jumping' jumps to the same procedure with the same name and parameter list. If there is no exact procedure, it jumps to the best candidate and positions the cursor on the first difference. (For Delphians: Delphi can not do this).
4545
4646For example a procedure with different parameter types:
4747
4848``` pascal
4949interface
5050
5151procedure DoSomething(p: char); // procedure definition
5252
5353implementation
5454
5555procedure DoSomething(p: string); // procedure body
5656begin
5757end;
5858```
5959
6060Jumping from the definition to the body will position the cursor at the 'string' keyword. This can be used for renaming methods and/or changing the parameters.
6161
6262For example:
6363
6464You renamed 'DoSomething' to 'MakeIt':
6565
6666``` pascal
6767interface
6868
6969procedure MakeIt; // procedure definition
7070
7171implementation
7272
7373procedure DoSomething; // procedure body
7474begin
7575end;
7676```
7777
7878Then you jump from MakeIt to the body. The IDE searches for a fitting body, does not find one, and hence searches for a candidate. Since you renamed only one procedure there is exactly one body without definition (DoSomething) and so it will jump to DoSomething and position the cursor right on 'DoSomething'. Then you can simply rename it there too. This works for parameters as well.
7979
8080## Include Files
8181
8282Include files are files inserted into sources with the {\$I filename} or {\$INCLUDE filename} compiler directive. Lazarus and FPC often uses include files to reduce redundancy and avoid unreadable {\$IFDEF} constructs, needed to support different platforms.
8383
8484Contrary to Delphi, the Lazarus IDE has full support for include files. You can for example jump from the method in the .pas file to the method body in the include file. All codetools like code completion consider include files as special bounds.
8585
8686For instance: When code completion adds a new method body behind another method body, it keeps them both in the same file. This way you can put whole class implementations in include files, as the LCL does for nearly all controls.
8787
8888But there is a trap for newbies: If you open an include file for the first time and try method jumping or find declaration you will get an error. The IDE does not yet know to which unit the include file belongs. You must open the unit first.
8989
9090As soon as the IDE parses the unit, it will parse the include directives there and the IDE will remember this relationship. It saves this information on exit and on project save to ~/.lazarus/includelinks.xml. The next time you open this include file and jump or do a find declaration, the IDE will internally open the unit and the jump will work. You can also hint the IDE by putting `{%mainunit yourunit.pas}` at the top of yourinclude.inc.
9191
9292This mechanism has limits. Some include files are included twice or more. For example: lcl/include/winapih.inc.
9393
9494How you will jump from the procedure/method definitions in this include file to their bodies will depend on your last action. If you worked on lcl/lclintf.pp the IDE will jump to winapi.inc. If you worked on lcl/interfacebase.pp, then it will jump to lcl/include/interfacebase.inc (or one of the other include files). If you are working on both, then you can get confused. ;)
9595
9696## Code Templates
9797
9898Code Templates converts an identifier into a text or code fragment.
9999
100-Code Templates default short cut is <span class="kbd">Ctrl</span>+<span class="kbd">J</span>. You can type an identifier, press <span class="kbd">Ctrl</span>+<span class="kbd">J</span> and the identifier is replaced by the text defined for the identifier. Code Templates can be defined in Tools -\> Options -\> CodeTools.
100+Code Templates default short cut is `Ctrl`+`J`. You can type an identifier, press `Ctrl`+`J` and the identifier is replaced by the text defined for the identifier. Code Templates can be defined in Tools -\> Options -\> CodeTools.
101101
102-Example: Write the identifier 'classf', leave the cursor right behind the 'f' and press <span class="kbd">Ctrl</span>+<span class="kbd">J</span>. The 'classf' will be replaced by
102+Example: Write the identifier 'classf', leave the cursor right behind the 'f' and press `Ctrl`+`J`. The 'classf' will be replaced by
103103
104104``` pascal
105105T = class(T)
106106private
107107
108108public
109109 constructor Create;
110110 destructor Destroy; override;
111111end;
112112```
113113
114114and the cursor is behind the 'T'.
115115
116-You can get the list of templates by positioning the cursor on space (not on an identifier) and pressing <span class="kbd">Ctrl</span>+<span class="kbd">J</span>. The list of code templates will pop up. Use the cursor keys or type some chars to choose one. Return creates the selected template and Escape closes the pop up.
116+You can get the list of templates by positioning the cursor on space (not on an identifier) and pressing `Ctrl`+`J`. The list of code templates will pop up. Use the cursor keys or type some chars to choose one. Return creates the selected template and Escape closes the pop up.
117117
118-The biggest time savers are templates 'b'+<span class="kbd">Ctrl</span>+<span class="kbd">J</span> for begin..end.
118+The biggest time savers are templates 'b'+`Ctrl`+`J` for begin..end.
119119
120120## Parameter Hints
121121
122122Parameter Hints shows a hint box with the parameter declarations for the current parameter list.
123123
124124For example: `Canvas.FillRect(|);`
125125
126-Place the cursor in the brackets and press <span class="kbd">Ctrl</span>+<span class="kbd">Shift</span>+<span class="kbd">space</span>. A hint box will show up showing the parameters of FillRect.
126+Place the cursor in the brackets and press `Ctrl`+`Shift`+`space`. A hint box will show up showing the parameters of FillRect.
127127
128-<figure>
129-<img src="Parameterhints1.png" title="Parameterhints1.png" />
130-<figcaption>Parameterhints1.png</figcaption>
131-</figure>
128+![](/wiki-images/c/c8/Parameterhints1.png)
132129
133130Since 0.9.31 there is a button to the right of each declaration to insert the missing parameters.This will copy the parameter names from the chosen declaration to the cursor position.
134131
135-<figure>
136-<img src="Parameterhints2.png" title="Parameterhints2.png" />
137-<figcaption>Parameterhints2.png</figcaption>
138-</figure>
132+![](/wiki-images/4/48/Parameterhints2.png)
139133
140134Hint: Use the Variable Declaration Completion to declare the variables.
141135
142136> **Note:** The short cut's name is "Show code context".
143137
144138## Incremental Search
145139
146-Incremental Search changes the statusbar of the source editor. Type some characters and the editor will search and highlight immediately all occurrences in the text. Shortcut is <span class="kbd">Ctrl</span>+<span class="kbd">e</span>.
140+Incremental Search changes the statusbar of the source editor. Type some characters and the editor will search and highlight immediately all occurrences in the text. Shortcut is `Ctrl`+`e`.
147141
148-- For example pressing <span class="kbd">e</span> will search and highlight all occurrences of 'e'.
149-- Then pressing <span class="kbd">t</span> will search and highlight all occurrences of 'et' and so forth.
150-- You can jump to the next with <span class="kbd">F3</span> (or <span class="kbd">Ctrl</span>+<span class="kbd">e</span> while in search) and the previous with <span class="kbd">Shift</span>+<span class="kbd">F3</span>.
142+- For example pressing `e` will search and highlight all occurrences of 'e'.
143+- Then pressing `t` will search and highlight all occurrences of 'et' and so forth.
144+- You can jump to the next with `F3` (or `Ctrl`+`e` while in search) and the previous with `Shift`+`F3`.
151145- Backspace deletes the last character
152146- return stops the search without adding a new line in the editor.
153-- You can resume the last search by pressing <span class="kbd">Ctrl</span>+<span class="kbd">e</span> a second time, immediately after you started incr-search with <span class="kbd">Ctrl</span>+<span class="kbd">e</span>. that is while the search term is still empty.
154-- Paste <span class="kbd">Ctrl</span>+<span class="kbd">V</span> will append the text from the clipboard to the current search text (since lazarus 0.9.27 r19824).
147+- You can resume the last search by pressing `Ctrl`+`e` a second time, immediately after you started incr-search with `Ctrl`+`e`. that is while the search term is still empty.
148+- Paste `Ctrl`+`V` will append the text from the clipboard to the current search text (since lazarus 0.9.27 r19824).
155149
156150### Hint: Quick searching an identifier with incremental search
157151
158152- Place text cursor on identifier (do not select anything)
159-- Press <span class="kbd">Ctrl</span>+<span class="kbd">C</span>. The source editor will select the identifier and copy it to the clipboard
160-- Press <span class="kbd">Ctrl</span>+<span class="kbd">E</span> to start incremental search
161-- Press <span class="kbd">Ctrl</span>+<span class="kbd">V</span> to search for the identifier (since 0.9.27)
162-- Use <span class="kbd">F3</span> and <span class="kbd">Shift</span>+<span class="kbd">F3</span> to quickly jump to next/previous.
153+- Press `Ctrl`+`C`. The source editor will select the identifier and copy it to the clipboard
154+- Press `Ctrl`+`E` to start incremental search
155+- Press `Ctrl`+`V` to search for the identifier (since 0.9.27)
156+- Use `F3` and `Shift`+`F3` to quickly jump to next/previous.
163157- Use any key (for example cursor left or right) to end the search
164158
165159## Syncro Edit
166160
167161Syncro Edit allows you to edit all occurrences of a word at the same time (synchronized). You simple edit the word in one place, and as you type, all other occurrences of the word are updated too.
168162
169163Syncro Edit works on all words in a selected area:
170164
171165- Select a block of text
172-- press <span class="kbd">Ctrl</span>+<span class="kbd">J</span> or click the icon in the gutter. (This only works, if there are any words that occur more than once in the selection.
166+- press `Ctrl`+`J` or click the icon in the gutter. (This only works, if there are any words that occur more than once in the selection.
173167 - From Lazarus 4.0 on the following are available:
174- - <span class="kbd">Ctrl</span>+<span class="kbd">J</span> Words are grouped independent of the upper/lower casing.
175- - <span class="kbd">Ctrl</span>+<span class="kbd">Shift</span>+<span class="kbd">J</span> Words are only grouped if they have the same upper/lower casing.
176- - <span class="kbd">Ctrl</span>+<span class="kbd">Alt</span>+<span class="kbd">J</span> Words are only grouped if they have the same context. Identifiers are different from the same word in a comment, or the same word as keyword or string.
177- - <span class="kbd">Ctrl</span>+<span class="kbd">Shift</span>+<span class="kbd">Alt</span>+<span class="kbd">J</span> Words are only grouped if they have the same context and same upper/lower casing.
178-- use the <span class="kbd">tab</span> key to select the word you want to edit (if several different words occurred more than once)
168+ - `Ctrl`+`J` Words are grouped independent of the upper/lower casing.
169+ - `Ctrl`+`Shift`+`J` Words are only grouped if they have the same upper/lower casing.
170+ - `Ctrl`+`Alt`+`J` Words are only grouped if they have the same context. Identifiers are different from the same word in a comment, or the same word as keyword or string.
171+ - `Ctrl`+`Shift`+`Alt`+`J` Words are only grouped if they have the same context and same upper/lower casing.
172+- use the `tab` key to select the word you want to edit (if several different words occurred more than once)
179173- Edit the word
180-- Press <span class="kbd">Esc</span> to finish
174+- Press `Esc` to finish
181175
182176See an animated example [[New IDE features since|here]]
183177
184-> **Note:** <span class="kbd">Ctrl</span>+<span class="kbd">J</span> is also used for template edit. It switches its meaning if you select some text.
178+> **Note:** `Ctrl`+`J` is also used for template edit. It switches its meaning if you select some text.
185179
186180## Find next / previous word occurrence
187181
188182The two functions can be found in the popup menu of the source editor
189183
190184- Source editor / popup menu / Find / Find next word occurrence
191185- Source editor / popup menu / Find / Find previous word occurrence
192186
193187And you can assign them shortcuts in the editor options.
194188
195189## Code Completion
196190
197-Code Completion can be found in the IDE menu Edit -\> Complete Code and has as standard short cut <span class="kbd">Ctrl</span>+<span class="kbd">Shift</span>+<span class="kbd">C</span>.
191+Code Completion can be found in the IDE menu Edit -\> Complete Code and has as standard short cut `Ctrl`+`Shift`+`C`.
198192
199-For Delphians: Delphi calls "code completion" the function showing the list of identifiers at the current source position (<span class="kbd">Ctrl</span>+<span class="kbd">Space</span>). Under Lazarus this is called "Identifier completion".
193+For Delphians: Delphi calls "code completion" the function showing the list of identifiers at the current source position (`Ctrl`+`Space`). Under Lazarus this is called "Identifier completion".
200194
201195Code Completion combines several powerful functions. Examples:
202196
203197- Class Completion: completes properties, adds/updates method bodies, add private variables and private access methods
204198- Forward Procedure Completion: adds procedure bodies
205199- Event Assignment Completion: completes event assignments and adds method definition and body
206200- Variable Declaration Completion: adds local variable definitions
207201- Procedure Call Completion: adds a new procedure
208202- Reversed procedure completion: adds procedure declarations for procedure/function bodies
209203- Reversed Class Completion: adds method declarations for method bodies
210204
211205Which function is used, depends on the cursor position in the editor and will be explained below.
212206
213-Code Completion can be found in the IDE menu Edit -\> Complete Code and has as standard short cut <span class="kbd">Ctrl</span>+<span class="kbd">Shift</span>+<span class="kbd">C</span>.
207+Code Completion can be found in the IDE menu Edit -\> Complete Code and has as standard short cut `Ctrl`+`Shift`+`C`.
214208
215209### Class Completion
216210
217211The most powerful code completion feature is "Class Completion". You write a class, add the methods and properties and Code Completion will add the method bodies, the property access methods/variables and the private variables.
218212
219213For example: Create a class (see Code Templates to save you some type work):
220214
221215``` pascal
222216TExample = class(TObject)
223217public
224218 constructor Create;
225219 destructor Destroy; override;
226220end;
227221```
228222
229-Position the cursor somewhere in the class and press <span class="kbd">Ctrl</span>+<span class="kbd">Shift</span>+<span class="kbd">C</span>. This will create the method missing bodies and move the cursor to the first created method body, so you can just start writing the class code:
223+Position the cursor somewhere in the class and press `Ctrl`+`Shift`+`C`. This will create the method missing bodies and move the cursor to the first created method body, so you can just start writing the class code:
230224
231225``` pascal
232226{ TExample }
233227
234228constructor TExample.Create;
235229begin
236230 |
237231end;
238232
239233destructor TExample.Destroy;
240234begin
241235 inherited Destroy;
242236end;
243237```
244238
245239> **Note:** The '\|' is the cursor and is not added.
246240
247-> **Tip:** You can jump between a method and its body with <span class="kbd">Ctrl</span>+<span class="kbd">Shift</span>+<span class="kbd">Up</span>.
241+> **Tip:** You can jump between a method and its body with `Ctrl`+`Shift`+`Up`.
248242
249243You can see, that the IDE added the 'inherited Destroy' call too. This is done, if there is an 'override' keyword in the class definition.
250244
251245Now add a method DoSomething:
252246
253247``` pascal
254248TExample = class(TObject)
255249public
256250 constructor Create;
257251 procedure DoSomething(i: integer);
258252 destructor Destroy; override;
259253end;
260254```
261255
262-Then press <span class="kbd">Ctrl</span>+<span class="kbd">Shift</span>+<span class="kbd">C</span> and the IDE will add
256+Then press `Ctrl`+`Shift`+`C` and the IDE will add
263257
264258``` pascal
265259procedure TExample.DoSomething(i: integer);
266260begin
267261 |
268262end;
269263```
270264
271265You can see, that the new method body is inserted between Create and Destroy, exactly as in the class definition. This way the bodies keep the same logical ordering as you define. You can define the insertion policy in Tools \> Options -\> Codetools -\> Code Creation.
272266
273267**Complete Properties**
274268
275269Add a property AnInteger:
276270
277271``` pascal
278272TExample = class(TObject)
279273public
280274 constructor Create;
281275 procedure DoSomething(i: integer);
282276 destructor Destroy; override;
283277 property AnInteger: Integer;
284278end;
285279```
286280
287-Press <span class="kbd">Ctrl</span>+<span class="kbd">Shift</span>+<span class="kbd">C</span> and you will get:
281+Press `Ctrl`+`Shift`+`C` and you will get:
288282
289283``` pascal
290284procedure TExample.SetAnInteger(const AValue: integer);
291285begin
292286 |if FAnInteger=AValue then exit;
293287 FAnInteger:=AValue;
294288end;
295289```
296290
297-The code completion has added a Write access modifier and added some common code. Jump to the class with <span class="kbd">Ctrl</span>+<span class="kbd">Shift</span>+<span class="kbd">Up</span> to see the new class:
291+The code completion has added a Write access modifier and added some common code. Jump to the class with `Ctrl`+`Shift`+`Up` to see the new class:
298292
299293``` pascal
300294TExample = class(TObject)
301295private
302296 FAnInteger: integer;
303297 procedure SetAnInteger(const AValue: integer);
304298public
305299 constructor Create;
306300 procedure DoSomething(i: integer);
307301 destructor Destroy; override;
308302 property AnInteger: integer read FAnInteger write SetAnInteger;
309303end;
310304```
311305
312306The property was extended by a Read and Write access modifier. The class got the new section 'private' with a Variable 'FAnInteger' and the method 'SetAnInteger'. It is a common Delphi style rule to prepend private variables with an 'F' and the write method with a 'Set'. If you don't like that, you can change this in Tools -\> Options \> Codetools -\> Code Creation.
313307
314308Creating a read only property:
315309
316310``` pascal
317311property PropName: PropType read;
318312```
319313
320314Will be expanded to
321315
322316``` pascal
323317property PropName: PropType read FPropName;
324318```
325319
326320Creating a write only property:
327321
328322``` pascal
329323property PropName: PropType write;
330324```
331325
332326Will be expanded to
333327
334328``` pascal
335329property PropName: PropType write SetPropName;
336330```
337331
338332Creating a read only property with a Read method:
339333
340334``` pascal
341335property PropName: PropType read GetPropName;
342336```
343337
344338Will be kept and a GetPropName function will be added:
345339
346340``` pascal
347341function GetpropName: PropType;
348342```
349343
350344Creating a property with a stored modifier:
351345
352346``` pascal
353347property PropName: PropType stored;
354348```
355349
356350Will be expanded to
357351
358352``` pascal
359353property PropName: PropType read FPropName write SetPropName stored PropNameIsStored;
360354```
361355
362356Because stored is used for streaming read and write modifiers are automatically added as well.
363357
364358Hint: Identifier completion also recognizes incomplete properties and will suggest the default names. For example:
365359
366360``` pascal
367361property PropName: PropType read |;
368362```
369363
370-Place the cursor one space behind the 'read' keyword and press <span class="kbd">Ctrl</span>+<span class="kbd">Space</span> for the identifier completion. It will present you the variable 'FPropName' and the procedure 'SetPropName'.
364+Place the cursor one space behind the 'read' keyword and press `Ctrl`+`Space` for the identifier completion. It will present you the variable 'FPropName' and the procedure 'SetPropName'.
371365
372366### Forward Procedure Completion
373367
374368"Forward Procedure Completion" is part of the Code Completion and adds missing procedure bodies. It is invoked, when the cursor is on a forward defined procedure.
375369
376370For example: Add a new procedure to the interface section:
377371
378372``` pascal
379373procedure DoSomething;
380374```
381375
382-Place the cursor on it and press <span class="kbd">Ctrl</span>+<span class="kbd">Shift</span>+<span class="kbd">C</span> for code completion. It will create in the implementation section:
376+Place the cursor on it and press `Ctrl`+`Shift`+`C` for code completion. It will create in the implementation section:
383377
384378``` pascal
385379procedure DoSomething;
386380begin
387381 |
388382end;
389383```
390384
391-Hint: You can jump between a procedure definition and its body with <span class="kbd">Ctrl</span>+<span class="kbd">Shift</span>+<span class="kbd">Up</span>.
385+Hint: You can jump between a procedure definition and its body with `Ctrl`+`Shift`+`Up`.
392386
393387The new procedure body will be added in front of the class methods. If there are already some procedures in the interface the IDE tries to keep the ordering. For example:
394388
395389``` pascal
396390procedure Proc1;
397391procedure Proc2; // new proc
398392procedure Proc3;
399393```
400394
401395If the bodies of Proc1 and Proc3 already exists, then the Proc2 body will be inserted between the bodies of Proc1 and Proc3. This behaviour can be setup in Tools -\> Options -\> Codetools -\> Code Creation.
402396
403397Multiple procedures:
404398
405399``` pascal
406400procedure Proc1_Old; // body exists
407401procedure Proc2_New; // body does not exist
408402procedure Proc3_New; // "
409403procedure Proc4_New; // "
410404procedure Proc5_Old; // body exists
411405```
412406
413407Code Completion will add all 3 procedure bodies (Proc2_New, Proc3_New, Proc4_New).
414408
415409Why is it called "Forward Procedure Completion"?
416410
417411Because it does not only work for procedures defined in the interface, but for procedures with the "forward" modifier as well. And because the codetools treats procedures in the interface as having an implicit 'forward' modifier.
418412
419413### Event Assignment Completion
420414
421415"Event Assignment Completion" is part of the Code Completion and completes a single Event:=\| statement. It is invoked, when the cursor is behind an assignment to an event.
422416
423417For example: In a method, say the FormCreate event, add a line 'OnPaint:=':
424418
425419``` pascal
426420procedure TForm1.Form1Create(Sender: TObject);
427421begin
428422 OnPaint:=|
429423end;
430424```
431425
432-The '\|' is the cursor and should not be typed. Then press <span class="kbd">Ctrl</span>+<span class="kbd">Shift</span>+<span class="kbd">C</span> for code completion. The statement will be completed to
426+The '\|' is the cursor and should not be typed. Then press `Ctrl`+`Shift`+`C` for code completion. The statement will be completed to
433427
434428``` pascal
435429OnPaint:=@Form1Paint;
436430```
437431
438432A new method Form1Paint will be added to the TForm1 class. Then class completion is started and you get:
439433
440434``` pascal
441435procedure TForm1.Form1Paint(Sender: TObject);
442436begin
443437 |
444438end;
445439```
446440
447441This works just like adding methods in the object inspector.
448442
449443> **Note:** You must place the cursor just after the ':=' assignment operator. If you place the cursor on the identifier (e.g. OnPaint) code completion will invoke "Local Variable Completion", which fails, because OnPaint is already defined.
450444
451445Hints:
452446
453447- You can choose the default visibility of the new method in Tools / Options / Codetools / Class Completion / Default section of methods (since 1.8)
454448- You can define the new method name by yourself. For example: `OnPaint:=@ThePaintMethod;`.
455449
456450Since 0.9.31 Lazarus completes procedure parameters. For example
457451
458452``` pascal
459453procedure TForm1.FormCreate(Sender: TObject);
460454var
461455 List: TList;
462456begin
463457 List:=TList.Create;
464458 List.Sort(@MySortFunction|);
465459end;
466460```
467461
468-Place the cursor on 'MySortFunction' and press <span class="kbd">Ctrl</span>+<span class="kbd">Shift</span>+<span class="kbd">C</span> for code completion. You get a new procedure:
462+Place the cursor on 'MySortFunction' and press `Ctrl`+`Shift`+`C` for code completion. You get a new procedure:
469463
470464``` pascal
471465function MySortFunction(Item1, Item2: Pointer): Integer;
472466begin
473467 |
474468end;
475469
476470procedure TForm1.FormCreate(Sender: TObject);
477471var
478472 List: TList;
479473begin
480474 List:=TList.Create;
481475 List.Sort(@MySortFunction);
482476end;
483477```
484478
485479### Variable Declaration Completion
486480
487481"Variable Declaration Completion" is part of the Code Completion and adds a local variable definition for a Identifier:=Term; statement. It is invoked, when the cursor is on the identifier of an assignment or a parameter.
488482
489483For example:
490484
491485``` pascal
492486procedure TForm1.Form1Create(Sender: TObject);
493487begin
494488 i:=3;
495489end;
496490```
497491
498-Place the cursor on the 'i' or just behind it. Then press <span class="kbd">Ctrl</span>+<span class="kbd">Shift</span>+<span class="kbd">C</span> for code completion and you will get:
492+Place the cursor on the 'i' or just behind it. Then press `Ctrl`+`Shift`+`C` for code completion and you will get:
499493
500494``` pascal
501495procedure TForm1.Form1Create(Sender: TObject);
502496var
503497 i: Integer;
504498begin
505499 i:=3;
506500end;
507501```
508502
509503The codetools first checks, if the identifier 'i' is already defined and if not it will add the declaration 'var i: integer;'. The type of the identifier is guessed from the term right to the assignment ':=' operator. Numbers like the 3 defaults to Integer.
510504
511505Another example:
512506
513507``` pascal
514508type
515509 TWhere = (Behind, Middle, InFront);
516510
517511 procedure TForm1.Form1Create(Sender: TObject);
518512 var
519513 a: array[TWhere] of char;
520514 begin
521515 for Where:=Low(a) to High(a) do writeln(a[Where]);
522516 end;
523517```
524518
525-Place the cursor on 'Where' and press <span class="kbd">Ctrl</span>+<span class="kbd">Shift</span>+<span class="kbd">C</span> for code completion. You get:
519+Place the cursor on 'Where' and press `Ctrl`+`Shift`+`C` for code completion. You get:
526520
527521``` pascal
528522 procedure TForm1.Form1Create(Sender: TObject);
529523 var
530524 a: array[TWhere] of char;
531525 Where: TWhere;
532526 begin
533527 for Where:=Low(a) to High(a) do writeln(a[Where]);
534528 end;
535529```
536530
537531Since 0.9.11 Lazarus also completes parameters. For example
538532
539533``` pascal
540534 procedure TForm1.FormPaint(Sender: TObject);
541535 begin
542536 with Canvas do begin
543537 Line(x1,y1,x2,y2);
544538 end;
545539 end;
546540```
547541
548-Place the cursor on 'x1' and press <span class="kbd">Ctrl</span>+<span class="kbd">Shift</span>+<span class="kbd">C</span> for code completion. You get:
542+Place the cursor on 'x1' and press `Ctrl`+`Shift`+`C` for code completion. You get:
549543
550544``` pascal
551545 procedure TForm1.FormPaint(Sender: TObject);
552546 var
553547 x1: integer;
554548 begin
555549 with Canvas do begin
556550 Line(x1,y1,x2,y2);
557551 end;
558552 end;
559553```
560554
561555Since 0.9.31 Lazarus completes pointer parameters. For example
562556
563557``` pascal
564558 procedure TForm1.FormCreate(Sender: TObject);
565559 begin
566560 CreateIconIndirect(@IconInfo);
567561 end;
568562```
569563
570-Place the cursor on 'IconInfo' and press <span class="kbd">Ctrl</span>+<span class="kbd">Shift</span>+<span class="kbd">C</span> for code completion. You get:
564+Place the cursor on 'IconInfo' and press `Ctrl`+`Shift`+`C` for code completion. You get:
571565
572566``` pascal
573567 procedure TForm1.FormCreate(Sender: TObject);
574568 var
575569 IconInfo: TIconInfo;
576570 begin
577571 CreateIconIndirect(@IconInfo);
578572 end;
579573```
580574
581-In all above examples you can use <span class="kbd">Ctrl</span>+<span class="kbd">Shift</span>+<span class="kbd">X</span> to show a Code Creation dialog where you can set more options.
575+In all above examples you can use `Ctrl`+`Shift`+`X` to show a Code Creation dialog where you can set more options.
582576
583577### Procedure Call Completion
584578
585579Code completion can create a new procedure from a call statement itself.
586580
587581Assume you just wrote the statement "DoSomething(Width);"
588582
589583``` pascal
590584procedure SomeProcedure;
591585var
592586 Width: integer;
593587begin
594588 Width:=3;
595589 DoSomething(Width);
596590end;
597591```
598592
599-Position the cursor over the identifier "DoSomething" and press <span class="kbd">Ctrl</span>+<span class="kbd">Shift</span>+<span class="kbd">C</span> to get:
593+Position the cursor over the identifier "DoSomething" and press `Ctrl`+`Shift`+`C` to get:
600594
601595``` pascal
602596procedure DoSomething(aWidth: LongInt);
603597begin
604598
605599end;
606600
607601procedure SomeProcedure;
608602var
609603 Width: integer;
610604begin
611605 Width:=3;
612606 DoSomething(Width);
613607end;
614608```
615609
616610It does not yet create functions nor methods.
617611
618612### Reversed Class Completion
619613
620614"Reversed Class Completion" is part of the **Code Completion** and adds a private method declaration for the current method body. It is invoked, when the cursor is in a method body, not yet defined in the class. This feature is available since Lazarus 0.9.21.
621615
622616For example:
623617
624618``` pascal
625619 procedure TForm1.DoSomething(Sender: TObject);
626620 begin
627621 end;
628622```
629623
630-The method DoSomething is not yet declared in TForm1. Press <span class="kbd">Ctrl</span>+<span class="kbd">Shift</span>+<span class="kbd">C</span> and the IDE will add "procedure DoSomething(Sender: TObject);" to the private methods of TForm1.
624+The method DoSomething is not yet declared in TForm1. Press `Ctrl`+`Shift`+`C` and the IDE will add "procedure DoSomething(Sender: TObject);" to the private methods of TForm1.
631625
632626For Delphians: Class completion works under Lazarus always in one way: From class interface to implementation or backwards/reversed from class implementation to interface. Delphi always invokes both directions. The Delphi way has the disadvantage, that if a typo will easily create a new method stub without noticing.
633627
634628### Comments and Code Completion
635629
636630Code completion tries to keep comments where they belong. For example:
637631
638632``` pascal
639633 FList: TList; // list of TComponent
640634 FInt: integer;
641635```
642636
643637When inserting a new variable between FList and FInt, the comment is kept in the FList line. Same is true for
644638
645639``` pascal
646640 FList: TList; { list of TComponent
647641 This is a comment over several lines, starting
648642 in the FList line, so codetools assumes it belongs
649643 to the FLIst line and will not break this
650644 relationship. Code is inserted behind the comment. }
651645 FInt: integer;
652646```
653647
654648If the comment starts in the next line, then it will be treated as if it belongs to the code below. For example:
655649
656650``` pascal
657651 FList: TList; // list of TComponent
658652 { This comment belongs to the statement below.
659653 New code is inserted above this comment and
660654 behind the comment of the FList line. }
661655 FInt: integer;
662656```
663657
664658### Method update
665659
666660Normally class completion will add all missing method bodies. (Since 0.9.27) But if exactly one method differ between class and bodies then the method body is updated. For example: You have a method *DoSomething*.
667661
668662``` pascal
669663 public
670664 procedure DoSomething;
671665 end;
672666
673667procedure TForm.DoSomething;
674668begin
675669end;
676670```
677671
678672Now add a parameter:
679673
680674``` pascal
681675 public
682676 procedure DoSomething(i: integer);
683677 end;
684678```
685679
686-and invoke Code Completion (<span class="kbd">Ctrl</span>+<span class="kbd">Shift</span>+<span class="kbd">C</span>). The method body will be updated and the new parameter will be copied:
680+and invoke Code Completion (`Ctrl`+`Shift`+`C`). The method body will be updated and the new parameter will be copied:
687681
688682``` pascal
689683procedure TForm.DoSomething(i: integer);
690684begin
691685end;
692686```
693687
694688## Refactoring
695689
696690### Invert Assignments
697691
698692Abstract
699693
700694"Invert Assignments" takes some selected pascal statements and inverts all assignments from this code. This tool is usefull for transforming a "save" code to a "load" one and inverse operation.
701695
702696Example:
703697
704698``` pascal
705699procedure DoSomething;
706700begin
707701 AValueStudio:= BValueStudio;
708702 AValueAppartment :=BValueAppartment;
709703 AValueHouse:=BValueHouse;
710704end;
711705```
712706
713707Select the lines with assignments (between begin and end) and do Invert Assignments. All assignments will be inverted and identation will be add automatically. For example:
714708
715709Result:
716710
717711``` pascal
718712procedure DoSomething;
719713begin
720714 BValueStudio := AValueStudio;
721715 BValueAppartment := AValueAppartment;
722716 BValueHouse := AValueHouse;
723717end;
724718```
725719
726720### Enclose Selection
727721
728722Select some text and invoke it. A dialog will popup where you can select if the selection should be enclosed into **try..finally** or many other common blocks.
729723
730724### Rename Identifier
731725
732726Place the cursor on an identifier and invoke it. A dialog will appear, where you can setup the search scope and the new name.
733727
734728- It will rename all occurences and only those that actually use this declaration. That means it does not rename declarations with the same name.
735729- And it will first check for name conflicts.
736730- Limits: It only works on pascal sources, does not yet rename files nor adapt lfm/lrs files nor lazdoc files.
737731
738732### Find Identifier References
739733
740734Place the cursor on an identifier and invoke it. A dialog will appear, where you can setup the search scope. The IDE will then search for all occurences and only those that actually use this declaration. That means it does not show other declarations with the same name.
741735
742736### Show abstract methods
743737
744738This feature lists and auto completes virtual, abstracts methods that need to be implemented. Place the cursor on a class declaration and invoke it. If there are missing abstract methods a dialog will appear listing them. Select the methods to implement and the IDE creates the method stubs. Since Lazarus 1.3 it adds missing *class interface* methods too.
745739
746740### Extract Procedure
747741
748742See [[IDE Window: Extract Procedure|Extract Procedure]].
749743
750744## Find Declaration
751745
752746Position the cursor on an identifier and do 'Find Declaration'. Then it will search the declaration of this identifier, open the file and jump to it. If the cursor is already at a declaration it will jump to the previous declaration with the same name. This allows to find redefinitions and overrides.
753747
754748Every find declaration sets a Jump Point. That means you jump with find declaration to the declaration and easily jump back with Search -\> Jump back.
755749
756750There are some differences to Delphi: the codetools work on sources following the normal pascal rules, instead of using the compiler output. The compiler returns the final type. The codetools see the sources and all steps in between. For example:
757751
758752The *Visible* property is first defined in *TControl* (controls.pp), then redefined in TCustomForm and finally redefined in TForm. Invoking find declaration on Visible will you first bring to Visible in TForm. Then you can invoke Find Declaration again to jump to Visible in TCustomForm and again to jump to Visible in TControl.
759753
760754Same is true for types like *TColor*. For the compiler it is simply a 'longint'. But in the sources it is defined as
761755
762756``` pascal
763757TGraphicsColor = -$7FFFFFFF-1..$7FFFFFFF;
764758TColor = TGraphicsColor;
765759```
766760
767761And the same for **forward defined classes**: for instance in *TControl*, there is a private variable
768762
769763``` pascal
770764FHostDockSite: TWinControl;
771765```
772766
773767Find declaration on TWinControl jumps to the forward definition
774768
775769``` pascal
776770TWinControl = class;
777771```
778772
779773And invoking it again jumps to the real implementation
780774
781775``` pascal
782776TWinControl = class(TControl)
783777```
784778
785779This way you can track down every identifier and find every overload.
786780
787781### Hints
788782
789-- ump back with <span class="kbd">Ctrl</span>+<span class="kbd">H</span>.
783+- ump back with `Ctrl`+`H`.
790784- view/navigate all visited locations via Menu: View -\> "jump history"
791785- With a 5 button Mouse the 2 extra buttons to go forward/backward between the visited points
792786
793787
794788using [[IDE Window: EditorMouseOptionsAdvanced|advanced mouse options]] the buttons can be remapped.
795789
796790## Identifier Completion
797791
798-"Identifier Completion" is invoked by <span class="kbd">Ctrl</span>+<span class="kbd">space</span>. It shows all identifiers in scope. For example:
792+"Identifier Completion" is invoked by `Ctrl`+`space`. It shows all identifiers in scope. For example:
799793
800794``` pascal
801795procedure TForm1.FormCreate(Sender: TObject);
802796begin
803797 |
804798end;
805799```
806800
807-Place the cursor between *begin* and *end* and press <span class="kbd">Ctrl</span>+<span class="kbd">space</span>. The IDE/CodeTools will now parse all reachable code and present you a list of all found identifiers. The CodeTools cache the results, so invoking it a second time will be much faster.
801+Place the cursor between *begin* and *end* and press `Ctrl`+`space`. The IDE/CodeTools will now parse all reachable code and present you a list of all found identifiers. The CodeTools cache the results, so invoking it a second time will be much faster.
808802
809803> **Note:** for Delphians: Delphi calls it *Code completion*.
810804
811805Some identifiers like 'Write', 'ReadLn', 'Low', 'SetLength', 'Self', 'Result', 'Copy' are built into the compiler and are not defined anywhere in source. The identifier completion has a lot of these things built in as well. If you find one missing, just create a feature request in the bug tracker.
812806
813-*Identifier completion* does not complete all **keywords**. So you can not use it to complete 'repe' to 'repeat'. For these things use <span class="kbd">Ctrl</span>+<span class="kbd">W</span> Word Completion or <span class="kbd">Ctrl</span>+<span class="kbd">J</span> Code Templates. Since 0.9.27 *identifier completion* completes some keywords.
807+*Identifier completion* does not complete all **keywords**. So you can not use it to complete 'repe' to 'repeat'. For these things use `Ctrl`+`W` Word Completion or `Ctrl`+`J` Code Templates. Since 0.9.27 *identifier completion* completes some keywords.
814808
815809Identifier completion shows even those identifiers, that are not compatible.
816810
817811### Matching only the first part of a word
818812
819813You can invoke identifier completion only on the first few characters in a word. Position the cursor within a word. *Only characters to the left of the cursor* will be used to look up identifiers. For example:
820814
821815``` pascal
822816procedure TForm1.FormCreate(Sender: TObject);
823817begin
824818 Ca|ption
825819end;
826820```
827821
828822The box will show you only identifiers beginning with 'Ca' ( \| indicates the cursor position).
829823
830824### Keys
831825
832826- Letter or number: add the character to the source editor and the current prefix. This will update the list.
833827- Backspace: remove the last character from source editor and prefix. Updates the list.
834828- Return: replace the whole word at cursor with the selected identifier and close the popup window.
835829- Shift+Return: as *Return*, but replaces only the prefix (left part) of the word at the cursor.
836830- Up/Down: move selection
837831- Escape: close popup without change
838832- Tab: completes the prefix to next choice. For example: The current prefix is 'But' and the identifier completion only shows 'Button1' and 'Button1Click'. Then pressing *Tab* will complete the prefix to 'Button1'.
839833- Else: as *Return* and add the character to the source editor
840834
841835### Methods
842836
843837When cursor is in a class definition and you identifier complete a method defined in an ancestor class the parameters and the override keyword will be added automatically. For example:
844838
845839``` pascal
846840TMainForm = class(TForm)
847841protected
848842 mous|
849843end;
850844```
851845
852846Completing **MouseDown** gives:
853847
854848``` pascal
855849TMainForm = class(TForm)
856850protected
857851 procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X,
858852 Y: Integer); override;
859853end;
860854```
861855
862856Note that in case there is a semicolon after the identifier
863857
864858``` pascal
865859TMainForm = class(TForm)
866860protected
867861 mous|;
868862end;
869863```
870864
871865then the default action is performed, which is to simply complete the identifier:
872866
873867``` pascal
874868TMainForm = class(TForm)
875869protected
876870 mousedown;
877871end;
878872```
879873
880874### Properties
881875
882876``` pascal
883877property MyInt: integer read |;
884878```
885879
886880Identifier completion will show **FMyInt** and **GetMyInt**.
887881
888882``` pascal
889883property MyInt: integer write |;
890884```
891885
892886Identifier completion will show **FMyInt** and **SetMyInt**.
893887
894888### Uses section / Unit names
895889
896890In uses sections the identifier completion will show the filenames of all units in the search path. These will show all lowercase (e.g. *avl_tree*), because most units have lowercase filenames. On completion it will insert the case of the unit (e.g. *AVL_Tree*).
897891
898892### Statements
899893
900894``` pascal
901895procedure TMainForm.Button1Click(Sender: TObject);
902896begin
903897 ModalRe|;
904898end;
905899```
906900
907901becomes:
908902
909903``` pascal
910904procedure TMainForm.Button1Click(Sender: TObject);
911905begin
912906 ModalResult:=|;
913907end;
914908```
915909
916910### Icons in completion window
917911
918912In Lazarus 1.9+, option exists to show icons instead of "types", for lines in the completion window. Picture shows these icons:
919913
920-<figure>
921-<img src="ide_completion_icons.png" title="ide_completion_icons.png" />
922-<figcaption>ide_completion_icons.png</figcaption>
923-</figure>
914+![](/wiki-images/e/e6/Ide_completion_icons.png)
924915
925916## Word Completion
926917
927-*Word Completion* is invoked by <span class="kbd">Ctrl</span>+<span class="kbd">W</span>. It shows all words of all currently open editors and can therefore be used in non pascal sources, in comments and for keywords.
918+*Word Completion* is invoked by `Ctrl`+`W`. It shows all words of all currently open editors and can therefore be used in non pascal sources, in comments and for keywords.
928919
929920Otherwise it works the same as identifier completion.
930921
931922## Unit / Identifier Dictionary (Cody)
932923
933924This dialog lets you search for identifiers in other units. The units do not yet have to be used by your code.
934925
935926This feature is part of the package "Cody". To activate the feature install the package.
936927
937928## Goto Include Directive
938929
939930"Goto Include Directive" in the search menu of the IDE jumps to {\$I filename} statement where the current include file is used.
940931
941932## Publish Project
942933
943934Creates a copy of the whole project. If you want to send someone just the sources and compiler settings of your code, this function is your friend.
944935
945936A normal project directory contains a lot of information. Most of it is not needed to be published: the .lpi file can contain session information (like caret position and bookmarks of closed units) and the project directory contains a lot of .ppu, .o files and the executable. To create a lpi file with only the base information and only the sources, along with all sub directories use "Publish Project".
946937
947938> **Note:** Since version 0.9.13 there is a new *Project Option* that allows you to store session information in a separate file from the normal .lpi file. This new file ends with the .lps extension and only contains session information, which will leave your .lpi file much cleaner.
948939
949940In the dialog you can setup a filter to include and exclude certain files; with the command after you can compress the output into one archive.
950941
951942## Hints from comments
952943
953944At several places the IDE shows hints for an identifier. For example when moving the mouse over an identifier in the source editor and waiting a few seconds. When the IDE shows a hint for an identifier it searches the declaration and all its ancestors and looks for comments and fpdoc files. There are many coding styles and many commenting styles. In order to support many of the common comment styles the IDE uses the following heuristics:
954945
955946### Comments shown in the hint
956947
957948Comments in front of a declaration, without empty line and not starting with the *\<* sign:
958949
959950``` pascal
960951var
961952 {Comment}
962953 Identifier: integer;
963954```
964955
965956Comments with the *\<* sign belong to the prior identifier.
966957
967958Comments behind an identifier on the same line:
968959
969960``` pascal
970961var
971962 identifier, // Comment
972963 other,
973964```
974965
975966Comments behind the definition on the same line:
976967
977968``` pascal
978969var
979970 identifier:
980971 char; // Comment
981972```
982973
983974An example for **\<** sign:
984975
985976``` pascal
986977const
987978 a = 1;
988979 //< comment for a
989980 b = 2;
990981 // comment for c
991982 c = 3;
992983```
993984
994985All three comment types are supported:
995986
996987``` pascal
997988 {Comment}(*Comment*)//Comment
998989 c = 1;
999990```
1000991
1001992### Comments not shown in the hint
1002993
1003994Comments starting with **\$** or **%** are ignored. For example *//% Hiddden*, *//\$ Hidden*, *(*\$ Hidden*)*.
1004995
1005996Comments in front separated with an empty line are treated as not specific to the following identifier. For example the following class header comment is not shown in the hint:
1006997
1007998``` pascal
1008999type
10091000 { TMyClass }
10101001
10111002 TMyClass = class
10121003```
10131004
10141005The class header comments are created on class completion. You can turn this off in the *Options / Codetools / Class completion / Header comment for class*. If you want to show the header comment in the hint, just remove the empty line.
10151006
10161007The following comment will be shown for GL_TRUE, but not for GL_FALSE:
10171008
10181009``` pascal
10191010 // Boolean
10201011 GL_TRUE = 1;
10211012 GL_FALSE = 0;
10221013```
10231014
10241015## Quick Fixes
10251016
10261017Quick Fixes are menu items for specific compiler messages. They help you to quickly fix the problem. Select a message in the *Messages* window and right click, or right click in the source editor on the icon to the left.
10271018
10281019- Unit not found: remove from uses section
10291020- Unit not found: find unit in loaded packages and allow to auto add package dependency
10301021- Constructing a class "\$1" with abstract method "\$2": show dialog to override all abstract methods
10311022- Local variable "\$1" not used: remove definition
10321023- Circular unit reference between \$1 and \$2: show Unit Dependencies dialog with full path between the two units
10331024- Identifier not found: search via Code Browser
10341025- Identifier not found: search via Cody Dictionary (needs package [[Cody]])
10351026- Identifier not found: add local variable
10361027- Recompiling \$1, checksum changed for \$2: show a dialog with search paths and other information
10371028- IDE warning: other sources path of package %s contains directory...: open package
10381029- any hint, note, warning: add IDE directive {%H-}
10391030- any hint, note, warning: add compiler directive {\$warn id off} (since 1.7)
10401031- any hint, note, warning: add compiler option -vm\<messageid\>
10411032- Local variable "i" does not seem to be initialized: insert assignment (since 1.5)
10421033- Inherited method is hidden: add modifier override, overload, or reintroduce (since 1.9)
10431034
10441035## Outline
10451036
10461037This option is located in the IDE Options dialog, Editor - Display - Markup and Matches - Outline (global).
10471038
10481039It makes highlighting of Pascal keywords together with their begin-end brackets. This allows to see nesting of big blocks. For example, for such procedure body:
10491040
10501041``` pascal
10511042 with ADockObject do
10521043 begin
10531044 if DropAlign = alNone then
10541045 begin
10551046 if DropOnControl <> nil then
10561047 DropAlign := DropOnControl.GetDockEdge(DropOnControl.ScreenToClient(DragPos))
10571048 else
10581049 DropAlign := Control.GetDockEdge(DragTargetPos);
10591050 end;
10601051 PositionDockRect(Control, DropOnControl, DropAlign, FDockRect);
10611052 end;
10621053```
10631054
10641055it highlights:
10651056
10661057- outer with-do-begin-end in orange
10671058- next if-then-begin-end in green
10681059- inner if-then-else in cyan
10691060
1070-<figure>
1071-<img src="ide_outline.png" title="ide_outline.png" />
1072-<figcaption>ide_outline.png</figcaption>
1073-</figure>
1061+![](/wiki-images/3/3c/Ide_outline.png)
10741062
10751063---
10761064*From the Free Pascal wiki, page "Lazarus IDE Tools", as it stood on 2024-05-10 after a change by Michael, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*

Back to history