CodeSense is a set of Studio features that intelligently assist you in writing code, providing lists of context sensitive options and information. Using CodeSense dramatically increases productivity, it gives you context sensitive information directly when you need it as you're typing code in the editor, so you don't have to leave the editor to look up references in the documentation. And it can even be used to complete your typing for you, minimizing typos etc.
CodeSense comprises the following features:
Ctrl+J
Displays a context sensitive list of available source code commands, classes, data types, methods, variables, constants, objects, etc. The list is context sensitive, and contains only the appropriate options for the context where it's invoked. Selecting an option from the list inserts the appropriate code in the editor.
The CodeSense list is invoked automatically as you're typing certain source code constructs, such as typing a struct variable name followed by dot for example, and it can also be invoked manually at any time by pressing Ctrl+J, to provide a list of valid options within the context.
Ctrl+Space
Auto-completes the word you're typing by filling in the rest of the variable name, method name etc. as soon as you have entered enough characters to disambiguate the term within the current context. Just type the first few letters of the name, and then press Ctrl+Space to invoke Code Complete. If what you have typed has more than one possible match or no match at all, Code Complete automatically displays a list of valid options by invoking List Members as above.
Ctrl+Shift+Space
Displays a tooltip with information about the parameters for the current method call. The current parameter is displayed in bold and automatically advanced as you type. Parameter Info is available for all functions, procedures, and properties of all classes and objects, and built-in language functions as well as external functions.
The Parameter Info tooltip is automatically displayed when typing a method call, such as using the Get, Set, or Send command, or within an expression. Parameter Info can also be manually invoked at any time within a valid parameter block of a method call context, by pressing Ctrl+Shift+Space.
Displays a tooltip with information about the symbol under the cursor. Quick Info gives you quick access to brief information about variables, classes, objects, methods etc. If there are multiple hits for the specified symbol, they will all be displayed.
Quick Info can be invoked by hovering the mouse cursor over a word in the editor.
Auto-completes code snippets by automatically closing the curent scope using the appropriate closing scope text, or automatically inserting other text. For example, typing Procedure followed by space automatically inserts End_Procedure in the appropriate location. Augmenting a method by typing the Procedure/Function followed by the method name and space, automatically inserts the parameters from the augmented method.
Locates the definition of the symbol under the cursor. Go To Definition lets you quickly find the definition of a specified symbol, by opening the file and locating the definition for classes, methods etc. Just right-click the superclass name in a Object or Class declaration for example, select Go To Definition and it will take you directly to the superclass definition, opening the file and locating the line of code for the definition.
Find All Occurrences finds all occurrences of the highlighted text.
By default, Find All Occurrences searches the entire make path, including libraries, the system library and including sub folders. Once Find in Files parameters are modified, those parameters are used.
It only searches files with recognized DataFlex file extensions (including user defined file name extensions).
Find All Occurrences complements the Go To Definition operation. Go To Definition will find the point where the searched symbol is declared, regardless of whether the file is in a library or is a system file. Find All Occurrences will find everywhere that the symbol is used, including within comments or quotes (unlike Go To Definition).
The found occurrences are displayed in the Find Results panel, sorted in order of the Workspace's make path. This means that Workspace folders are sorted to the top, which means the hits you are most likely interested in are at the top of the list.
The Object Browser CodeSense list gives you a focused list of methods for the specified object, so you can easily find and select a method of a particular object. After selecting a method, CodeSense automatically completes the method call to the specified object by additionally inserting the appropriate object access code after the specified method name.
The Object Browser can be invoked in Get, Set, and Send commands, as well as in expressions. For example: Get <Ctrl+Space> and then select Browse Objects at the very top of the list.
CodeSense information is available for practically every language command, all classes, objects, methods, variables, struct types etc., including your own classes and methods from your source code. CodeSense information is always up to date, as soon as you declare a variable, or add a Use statement, for example, the information is immediately available.
Video clips demonstrating CodeSense:
Using CodeSense in a method call.
Using CodeSense with auto-complete.
Using CodeSense with the object brower.
Using CodeSense with variables and struct types.
More examples of using CodeSense:
Get <Ctrl+Space>
displays a CodeSense list of all available functions.
Send Foo to <Ctrl+Space>
displays a CodeSense list of all available objects.
Move <Ctrl+Space>
displays a CodeSense list of all available variables and constants.
Move abc to <Ctrl+Space>
displays a CodeSense list of all available variables that can be assigned.
<Ctrl+Space>
on the beginning of a line displays a CodeSense list of all available language commands and data types, including your own data types.
The Studio also helps write SQL queries by supplying CodeSense in your SQL statements. It will do this when using @SQL strings in the language or when editing .sql files with the Query Tester.