SDI features
This topic includes the following sections:
- Features available to all Synergy projects in Visual Studio
- Additional features for Synergy .NET
- Additional features for traditional Synergy
- xfODBC specialization file
- Synergy comments, XML doc comments, and task list tokens
- Synergy code snippets
When you install Synergy DBL Integration for Visual Studio (SDI), the Synergy DBL language, the Synergy compilers, and Synergy debugging are integrated with Visual Studio. This integration enables you to
- create Synergy projects in Visual Studio. SDI supports project wizards and designers in Visual Studio and includes Synergy project and item templates. See Synergy/DE project templates and Synergy/DE item templates for more information.
- write and edit code using the Visual Studio editor. You can use features such as IntelliSense, colorization, and regions. SDI also includes Synergy-specific code snippets and support for some Visual Studio comment features, including task list tokens. See Synergy code snippets and Synergy comments, XML doc comments, and task list tokens below.
- set Synergy-specific Visual Studio settings. SDI includes Synergy-specific project, text editor, and IntelliSense settings, including a way to register file extensions other than the defaults (.dbl, .dbc, .def, and .rec) and support for EditorConfig. See Options for Synergy/DE projects, Synergy/DE project properties, and Using EditorConfig with Synergy projects.
- build Synergy projects in Visual Studio. You can set build options (e.g., compiler options) in Visual Studio, and you can employ different build configurations, such as 32-bit or 64-bit. See Configurations, platforms, and profiles. You can also build Synergy projects from the command line with MSBuild, enabling you to use options such as /graphBuild (which is supported with Visual Studio 2019 version 16.8 or higher). And note that if a project uses SolutionDir, the SolutionDir setting must be specified on the command line (e.g., msbuild.exe /p:SolutionDir=C:\mysolutionfolder\ /graph mysolution.sln).
- debug Synergy applications and libraries from within Visual Studio. For both traditional Synergy and Synergy .NET, you’ll use Visual Studio commands to debug within Visual Studio. SDI's support for Visual Studio includes support for remote debugging, which enables you to debug Synergy programs running on other machines. For traditional Synergy, remote debugging enables you to debug Synergy programs on remote Windows, UNIX, and OpenVMS machines, and it enables you to debug traditional Synergy programs even when there are no Visual Studio projects for the programs. See Debugging traditional Synergy with Visual Studio and Debugging Synergy .NET Code.
- Create and run unit tests for Synergy .NET and traditional Synergy projects. See Unit Testing for Synergy .NET and Unit testing for traditional Synergy.
- access Synergy online documentation for Synergy features, errors, routines, and statements. See Accessing Synergy/DE documentation from Visual Studio.
Features available to all Synergy projects in Visual Studio
For Synergy projects, SDI adds the following to the Visual Studio Build menu:
- Stop Build on First Error stops a Synergy project build as soon as an error is encountered in the project.
Enabling Stop Build on First Error may have unexpected consequences and may cause errors when used in conjunction with parallel builds. |
Due to a conflict with SQL Server Data Tools (SSDT) projects, Stop Build on First Error does not automatically cancel builds when an SSDT project is detected in the current solution. |
- Project Only, which has the following project-specific versions of standard Visual Studio build commands: Build Only Project, Rebuild Only Project, Clean Only Project. Project Only is available on the Build menu only when a Synergy project node is selected in Solution Explorer. It is also available on the context menu that opens when your right-click a project node in Solution Explorer.
The difference between the commands under Project Only and the standard project-specific build commands (e.g., Build > Build MyProject) is that the Project Only commands do not affect referenced projects. The standard project-specific commands do affect (i.e., they do build, rebuild, and clean) referenced projects. Note, however, that we generally recommend using solution builds to ensure that resulting assemblies are built correctly. If you do build projects separately, the Clear Error List command (discussed below) can make it easier to use the Visual Studio Error List.
Additionally, a few menu entries are added to the Tools menu when a solution with a Synergy project is open in Visual Studio:
- C# to DBL Code Converter opens a utility that converts C# code to Synergy DBL code. To access this utility, select Tools > C# to DBL Code Converter from the Visual Studio menu. See Using the C# to DBL Code Converter.
- C# to DBL Solution Converter opens a utility that converts a C# solution into a Visual Studio solution with Synergy .NET projects. To access this utility, select Tools > C# to DBL Solution Converter from the Visual Studio menu. See Using the C# to DBL Solution Converter.
- Clear Error List removes Synergy-related errors and warnings from the Visual Studio Error List. This can be useful when using Project Only builds. For example, if you individually build three Synergy projects in the same Visual Studio session, errors for all three builds will be displayed in the Error List unless you use the Clear Error List command between builds.
- Command Prompt (x86) and Command Prompt (x64) open the standard Visual Studio Command Prompt. This prompt automatically sets environment variables for .NET Framework tools. See Microsoft documentation for information.
- Synergy/DE Repository launches Synergy/DE Repository.
- Synergy Background Log File displays logging for use by Synergy/DE Developer Support.
- Online and Local entries under Synergy/DE Documentation launch the Synergy/DE documentation at www.synergex.com/docs or locally installed Synergy/DE documentation.
The context menu that opens when you right-click an .INCLUDE statement includes Open File, which opens the specified include file in the Visual Studio editor.
A DBL Background pane is available in the Visual Studio Output window once a Synergy project has been opened in a Visual Studio session. This pane logs background IntelliSense and prototyping messages and is for use by Synergy/DE Developer Support. To view this pane, open a Synergy project and then open the Visual Studio Output window (View > Output) and select “DBL Background” in the “Show output from” drop-down list at the top of the window.
Additional features for Synergy .NET
For Synergy .NET projects, SDI also includes runtime libraries for Windows desktop and server applications. (A NuGet package is available with runtime libraries for devices; see Synergy .NET Requirements.) It also includes Synergy-specific Watch and QuickWatch commands for debugging (see Debugging Synergy .NET Code).
Additional features for traditional Synergy
For traditional Synergy development, SDI also includes the following:
- A project conversion utility (syn2vs) that turns Workbench projects and other Synergy files into Visual Studio projects. See the document Migrating Traditional Synergy Projects to Visual Studio in the Resource Center on the Synergex website for information on this feature and important issues you should keep in mind as you move traditional Synergy code to Visual Studio.
- Project templates for OLB, ELB, and DBR projects, including traditional Synergy unit test projects.
- An enhanced Reference Manager dialog that enables you to reference ELBs and OLBs in locations defined by environment variables. See Referencing ELBs and OLBs.
- A project setting that enables you to control link order for libraries. See Setting link priority for traditional Synergy in Visual Studio.
- A Prototypes node under each project node in Solution Explorer. This is for a feature that enables you to resolve circular references as described in Creating a prototype-only reference. For information on using this feature with legacy code that has been moved into Visual Studio, see the document Migrating Traditional Synergy Projects to Visual Studio in the Resource Center on the Synergex website.
- For Multiple Mainline projects, the “Start Debugging”, “Start Without Debugging”, and “Set as Startup Object” menu entries are added to the context menu that opens when you right-click a source file in Solution Explorer. “Start Debugging” and “Start Without Debugging” run the .dbr for the source file you right-clicked. “Set as Startup Object” sets the “Startup object” option on the Application page of Visual Studio project properties to the selected program.
- The following menu entries are added to the Tools menu when a traditional Synergy project is open in Visual Studio: "Synergy Composer", which launches Composer (a user interface designer for UI Toolkit applications) and "Synergy Method Definition Utility", which launches the MDU utility (a utility used to add, change, and delete data in Synergy method catalogs).
xfODBC specialization file
SDI includes the xfODBCSpecialization15.dll file, which is specifically for xfODBC. This file enables xfODBC data sources to be used in the data designer for Visual Studio 2017 and 2019. To use xfODBC data sources in these versions of Visual Studio, you must install SDI (even if you don't plan to develop Synergy applications or libraries in Visual Studio).
Synergy comments, XML doc comments, and task list tokens
In both traditional Synergy and Synergy .NET code, the semicolon (;) is used for code comments. And with Synergy .NET, three consecutive semicolons (;;;) are used for documentation comments. See Comments and Documentation comments for general information, and note the following:
- You can use some Visual Studio shortcuts (e.g., CTRL+K, CTRL+C) to add and remove Synergy comments when editing in Visual Studio.
-
Documentation comments can be used to generate XML documentation and are used as a source for IntelliSense information (see IntelliSense for Synergy files).
See the Synergex YouTube video Using XML Documentation Comments to Improve IntelliSense. |
-
SDI includes code snippets for adding documentation comment blocks. See Synergy code snippets below and the video mentioned above for more information.
-
Task list tokens are supported in Synergy comments (including XML documentation comments). Tokens listed in the Task List pane of the Options dialog (Tools > Options > Environment > Task List) are supported and cause comments that include them to appear in the Tokens List. This includes the standard tokens (e.g., TODO), and custom tokens, which you can add in the Task List pane.
Synergy code snippets
SDI includes the following code snippets for use in Synergy source files. To see these snippets, open the Code Snippets Manager (Tools > Code Snippet Manager) and select Synergy as the language in this dialog. The Code Snippets Manager lists all the Synergy code snippets, includes a description of what each code snippet does, and shows the shortcut for each snippet. For more information on using code snippets, see Visual Studio documentation.
Snippet shortcut(s) |
Snippet adds... |
---|---|
.region |
A region (.REGION-.ENDREGION) |
~ |
A destructor |
attribute |
An attribute |
begin |
A BEGIN-END block |
case |
A CASE statement |
class | A class |
common | A shared data record (COMMON-ENDCOMMON) |
ctor | A constructor |
cw | A Console.WriteLine statement |
delegate | A delegate |
;;; |
A summary documentation comment |
doforever | A DO-FOREVER loop |
dountil | A DO-UNTIL loop |
enum | An enumeration |
equals | An Equals() method |
exception | An exception |
external | An external function |
for | A FOR-FROM-THRU loop |
fordo | A FOR-DO loop |
foreach | A FOREACH loop |
forfromthru | A FOR-FROM-THRU loop |
foruntildo | A FOR-UNTIL-DO loop |
function | A Synergy function |
gds |
A global data section |
group | A group |
if | An IF statement |
ifthenelse | An IF-THEN-ELSE statement |
indexer | An indexer |
interface | An interface |
invoke | A safe event invocation |
iterator | A simple iterator |
iterindex | A named iterator/indexer pair using a nested class |
literal | A literal |
main | A Synergy main routine |
mbox | A .NET MessageBox.Show statement |
method | A method |
namespace | A namespace |
.if | A preprocessor .IF statement |
.ifdef | A preprocessor .IFDEF statement |
prop | An auto-implemented property with a field for the getter and setter |
propa | A dependency property |
propauto | A property |
propdp | A dependency property |
property |
An auto-implemented property (without a field for the getter and setter) |
record | A record |
structure | A structure |
subroutine | A Synergy subroutine |
using | A Synergy USING statement |
try | A TRY-CATCH statement |
tryf | A TRY-CATCH-FINALLY statement |
while | A WHILE loop |