Home - gregfullman/VSGenero GitHub Wiki
VSGenero is an extension for Visual Studio providing support for the Genero BDL (Business Development Language). The goal of VSGenero is to provide en experience similar to the C# editor in Visual Studio.
Please note: this documentation is out of date. It will be updated in the near future.
Version | Notes |
---|---|
0.9.7.6 |
|
0.8.0 |
|
0.7.9 |
|
0.7.8 and below | Release notes coming soon... |
VSGenero was written using the current extensibility framework in Visual Studio 2010 and above, so VSGenero is only supported in these versions.
In Visual Studio, open the Extension Manager (Tools -> Extension Manager...), and select Online Gallery. Then enter "genero" in the search box. The VSGenero extension should show up. Click to install.
In Visual Studio 2013 and above, you will see a different entry:
The version to be installed will be automatically determined by Visual Studio.
If you should ever need to uninstall VSGenero (perhaps the extension is affecting something in Visual Studio to the point that it can't be overcome), the preferred method for doing so is using the Extension Manager. To access the Extension Manager, go to Tools -> Extension Manager... on the top menu bar. Under Installed Extensions, select VSGenero (or VSGenero2013 if you are using Visual Studio 2013). This presents two options, Disable and Uninstall. Disable will temporarily disable the extension until you choose to enable it again (this is useful in determining if an extension is causing a problem within Visual Studio). Uninstall will remove the extension completely.
If you should ever need to remove VSGenero and are unable to start Visual Studio (yes, this has happened before!), you will have to remove the extension files manually. To do this, open Windows Explorer and go to this directory: C:\Users\{username}\AppData\Local\Microsoft\VisualStudio\{VS_Version}\Extensions, where username is your Windows username and VS_Version is 10.0 for Visual Studio 2010, and 12.0 for Visual Studio 2013. Once you are in this directory, you will see one or more folders with random numbers and letters. One of these folders contains the VSGenero extension files; you will have to determine which one it is. An easy way to tell is if the folder contains VSGenero.dll. Remove this folder, and this will manually uninstall the extension.
- Text Editor -> Genero4GL -> General
- enable Line numbers (if you want)
- Text Editor -> Genero4GL -> Tabs
- set Indenting to Block
- set your desired tab size
- use Insert Spaces
- Text Editor -> GeneroPER -> General
- enable Line numbers (if you want)
- Text Editor -> GeneroPER -> Tabs
- set Indenting to Block
- set your desired tab size
- use Insert Spaces
To create a new file within Visual Studio, go to File -> New -> File.... When the New File dialog opens, select Genero under Installed Templates. This page gives you the option of creating a 4GL file or PER file.
To open a file, simply select any .4gl or .per file from within Visual Studio. This includes opening via the Source Control explorer. Note: If a file is opened from within the Source Control explorer, it will automatically check out the file if any changes were made. If a file is opened in Source Control explorer and it doesn't currently reside in your workspace, the file is copied from the source control server to a temp directory on your machine, and is Read Only in the editor.
The syntax highlighting scheme used for Genero files is the same as the one used from the core Visual Studio languages (C#, C/C++, Visual Basic, etc.). (<xr id="syntax_highlighting"></xr>) If you want to change the colors for any reason, go to Tools -> Options... and select the Environment -> Fonts and Colors option page. You will want to select "Show settings for:" as "Text Editor" and then change the background, foreground, and font on the following items:
- Comment
- Identifier
- Keyword
- Literal
- Number
- any others you want to play with (VSGenero only breaks tokens into the above groups)
VSGenero keeps track of the functions within a .4gl file. To quickly navigate between functions, or to see what functions are within the file, you can use the function drop-down list at the top of the file view. The function list will also track which function your cursor is currently in. If the cursor is not within a function, the function list will show no function.
Functions can be collapsed and expanded, just like the C# editor allows for classes, functions, and other structures.
VSGenero collects information about file contents (variables, functions, cursors, etc.) defined and referenced within a 4gl file. If the information is available, when you hover your cursor over a file element a Quick Info box will appear.
The Go To Definition functionality allows the user to quickly navigate to the location where a function, variable, cursor, etc. is defined. This includes the case where a global variable is defined in a dedicated global file, or if the function is publicly defined via a link program (routine). To go to a definition, simply place your cursor on a file element and either press F12 or open the context menu by right-clicking and selecting **Go To Definition**. If the element's definition is in another file, that file will be opened.
In Visual Studio 2013 a new option was added to the context menu for the core languages, called Peek Definition. This allows the user to see the file element's definition without navigating away from the selected reference. To peek a definition, place your cursor on a file element and either press **Alt-F12** or open the context menu by right-clicking and select **Peek Definition**. Any content in the Peek Definition window will be displayed read-only, to ensure nothing is changed while viewing.
Intellisense Completion is enabled by default for 4gl files (an option to disable Completion will be added soon). In most situations, as you type you will see a list of completion options that get filtered with each character typed. The following completions are made available:
- Genero keywords
- Variables (local, module, global, and system)
- Available functions
- Local functions (within the current file)
- Module functions (functions within the other program files, not supported yet)
- Genero Classes