Skip to content
Greg Fullman edited this page Jun 17, 2016 · 3 revisions

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.

Table of Contents

Release Notes

Version Notes
0.9.7.6
  • Fixed various memory leaks that were causing the Visual Studio process to hold document data in memory even if they had been closed.
0.8.0
  • Starting to add language preferences support. Right now, it really only allows the user to turn on/off the navigation drop-down for function list, but the plan is to align the language preferences more with what is supported in C# (as much as possible).
  • Fixed some member completion bugs in the intellisense engine.
  • Fixed some other random bugs
0.7.9
  • Bug fixes
    • Brace matching tagger threw an exception when content of file had outlines but then they were removed (i.e. clearing the file)
    • Incomplete strings (while typing) were causing function parsing to fail. At some point, I'll figure out how to do multi-line strings correctly.
    • Fixed bug in quick info (exception being thrown).
    • Fixed issue where entering a backslash in an incomplete string threw exception.
  • Adjustments were made to the parser for define, type, and constant definition analysis determine if the block is incomplete (needed for completion analysis).
  • Added a few new keywords
  • Fixed the drop-down function list client so that if more than one window of the same document is opened, the function list will appear in subsequent windows.
  • Square bracket characters now commit a completion. NOTE: at some point the completion characters will be user-configurable like the C# editor.
  • Private functions (within the current file) are now being included in the completion list.
0.7.8 and below Release notes coming soon...

Supported Versions

VSGenero was written using the current extensibility framework in Visual Studio 2010 and above, so VSGenero is only supported in these versions.

Installation

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.

Uninstallation

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.

Settings

  • 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

Editor Functionality

Creating a new file

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.

Opening a 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.

Syntax Highlighting

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)

Function List

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.

Function Outlining

Functions can be collapsed and expanded, just like the C# editor allows for classes, functions, and other structures.

Intellisense

Quick Info

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.

Go To Definition

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.

Peek Definition (VS2013 only)

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.

Completion

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
Some attempt is made to display completions with respect to context. For instance, if you are typing just after a **call** keyword, only functions will be displayed in the completion list. Context-sensitive completion is not even close to being complete, so it will improve in the future.