Lahey Fortran

Code Snippets

Code Snippets are a source code editor feature that assists rapid development by allowing pre-defined blocks of code to be easily inserted into the editor. Snippets are normally code that is often entered, such as IF constructs, FUNCTION definitions, and header comment blocks.

Code Snippets can be inserted by selecting from the Code Completion list (press Tab after selecting), or by right-clicking and selecting "Insert Snippet...".

When a Snippet is first inserted, the snippet-entry mode is activated. The names that are normally changed by the author will be highlighted fields. When the cursor is in a field, that field's text can be changed. Press Tab to move to the next field. Press Enter when finished changing the fields, thereby terminating snippet-entry mode. It is possible for a Code Snippet to have no fields and not activate the snippet-entry mode.

Code Snippet types

Pre-defined Code Snippets

User-defined Code Snippets

Users can define any number of Code Snippets. Author a Snippet in a file with the ".snippet" extension. Select "Code Snippet Manager..." from the Tools menu. Select "LF Fortran" as the Language and click "Add...". Browse to the folder where your Snippet files are stored and click "Select Folder". Click OK to close the Code Snippet Manager. Your Code Snippets will now be displayed in the completion list and and Insert Snippet list.


See Also

Creating Code Snippets