AtanaSuite Connect

Expansion Snippet Example

By: | Posted on: | Category:

Here is the XML code for a sample Expansion snippet. In this example, the "sts+TAB" shortcut keys may be used to insert a SELECT TOP SQL statement into the SQL editor window prompting the user for count, table and where clause.

NOTE - This sample is also included in the example snippet.xml file that is created in the users snippets folder upon first use of snippets within AtanaSuite.

<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets xmlns="">
    <CodeSnippet Format="1.0.0">
            <Title>SELECT TOP *</Title>
            <Shortcut>sts</Shortcut> <!-- typing this shortcut followed by the Tab key will insert this snippet -->
            <Description>Selects TOP X rows from a table/view</Description>
                <SnippetType>Expansion</SnippetType><!-- Expansion inserts new text at the caret; SurroundsWith places new text before and after the selection -->
                    <ToolTip>The table to select from.</ToolTip>
                    <ToolTip>The number of rows to select.</ToolTip>
                    <ToolTip>The WHERE clause.</ToolTip>
                The following tokens can be used in the Code element below:
                    $literal ID$ - The ID of a literal defined in the Declarations section above.
                                   If a literal is referenced multiple times, the first instance
                                   is editable and the value will be applied to all locations.
                    $selected$ - The selected text in the editor at the time a SurroundsWith snippet was inserted.
                    $end$ - The location for the caret after completion.
            <Code Language="sql">

Friday August 20th, 2021
Monday August 2nd, 2021
© 2002 - 2021 Atanasoft LLC. All rights reserved.