SDI features
This topic includes the following sections:
- Features for both .NET and traditional 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 Visual Studio Components for SDI (see www.synergex.com/synergy-dbl-integration), 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. You can also use the Synergex.Projects.Templates and Synergex.ProjectItem.Templates NuGet packages with the .NET CLI to create Synergy projects. See Synergy/DE project templates and Synergy/DE item templates for more information.
- write and edit code using the Visual Studio editor. As you write Synergy code, you can use features such as IntelliSense, colorization, and regions. Colorization is also supported for repository schema files. Additionally, SDI 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. For more information on IntelliSense, see IntelliSense for Synergy files.
- 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 and from the command line. 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 use the .NET CLI to build Synergy projects from the command line, and you can build Synergy projects from the command line with MSBuild, enabling you to use options such as /graphBuild. (If a project uses SolutionDir, the SolutionDir setting must be specified on the MSBuild command line—e.g., msbuild.exe /p:SolutionDir=C:\mysolutionfolder\ /graph mysolution.sln.)
- debug Synergy applications and libraries from Visual Studio. For both traditional Synergy and Synergy .NET, you’ll use Visual Studio commands to debug within Visual Studio. SDI includes support for remote debugging, which enables you to debug Synergy programs running on other machines. 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 .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.
Note that you can install MSBuild Components for SDI without installing SDI’s Visual Studio Components. This enables you to set up a build server for Synergy project builds without requiring the Visual Studio IDE. (See www.synergex.com/synergy-dbl-integration for more information.) The features described in this documentation apply to SDI with the full Visual Studio IDE, not to MSBuild Components when installed without SDI Visual Studio components.
Features for both .NET and traditional 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. This 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:
- SDI Update opens the SDI Update window in Visual Studio. (This window also opens automatically if a new version of SDI is available when you open Visual Studio.) It includes links that enable you to download and view information on the latest SDI version:
- To navigate to the download page for the new version, click the "Latest SDI Download" link.
- To view release notes for the latest SDI version in a browser window, click the "Release notes" link.
- To view the latest SDI blog entry, go to www.synergex.com/blog/tag/sdi/, and click the link for the most recent blog.
- To close this window and prevent it from opening automatically for the next two weeks, click the "Remind Me Later" link. After two weeks, the window will open automatically when you open Visual Studio if there is a more recent version of SDI than the version installed on your machine.
- 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. This utility has been deprecated. See Using the C# to DBL Code Converter for more information.
- 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. This utility has been deprecated. See Using the C# to DBL Solution Converter for more information.
- 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. The environment for a command prompt opened with one of these menu entries automatically includes environment variable settings for .NET tools, environment variable settings from the project, and Common Properties settings that have been applied to the project.
- 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.
-
Synergy DBL Integration Improvement Program opens a dialog that enables you to allow or prevent SDI telemetry, which collects anonymous data on SDI performance and usage. See Synergy DBL Integration Improvement Program below for more information.
-
Flush Project Up-To-Date Telemetry Data clears all build-related telemetry data from memory for the current Visual Studio session. See Synergy DBL Integration Improvement Program below for more information, including information on when this menu entry is available.
The following are also added:
- 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.
- 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 executable for the source file you right-clicked. “Set as Startup Object” sets the “Startup object” (an option on the Application page of Visual Studio project properties) to the selected program.
- 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.
- A Working directory setting is added to the Application page of project properties. This specifies the working directory that will be used for compiler commands. For example, if your code has an .INCLUDE statement that doesn’t specify a path, you’ll need to set the “Working directory” option to the directory with the included file. See Application page of Visual Studio project properties (Synergy .NET) or Application page of Visual Studio project properties (traditional Synergy) for more information.
- SDI includes an experimental option to reduce load times for Synergy projects. To invoke this feature, set the SDI_FAST_MODE environment variable to any value (i.e., set it to anything other than blanks or an empty string) before starting Visual Studio. NOTE: This functionality may cause project references to load in an incorrect order, which could lead to an invalid project state.
Synergy DBL Integration Improvement Program
The Synergy DBL Integration Improvement Program, which is the name of SDI’s telemetry functionality, collects information to help debug issues with customer projects, and it tracks issues and project information to help us prioritize fixes and new features. SDI includes a number of features related to this telemetry, including features that enable you to participate in or opt out of this program and allow or prevent the collection of additional build-related data. For details on SDI telemetry, including information on what is collected, how we use telemetry data, how we remove personal information from collected data, and how to opt in or out, see Synergy DBL Integration Improvement Program (SDI telemetry).
Additional features for Synergy .NET
For Synergy .NET projects, SDI also includes the following:
- runtime libraries for Windows desktop and server applications. (A NuGet package is available with runtime libraries for devices; see Synergy .NET Requirements.)
- 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 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, DBR, and UI Toolkit window library (Script) projects, as well as 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 on the Synergex website.
- 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. 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 |