DragonScript Language Support
This extension provides language server support for the DragonScript Script Language.
The DragonScript repository can be found here:
Latest API documentation can be found here:
Main use is for creating games using the Drag[en]gine Game Engine:
Module API documentation and Usage pages on the Wiki can be found here:
The DragonScript Script Language can be used standalone (using the "dsi" binary)
or as embedded language using a C++ Binding. Embedding DragonScript is rather
simple and allows mixing script with native code easily without using unsafe
C-Call hacks.
The Language is strong typed, object oriented and uses a forward parsing only grammar.
The language server supports:
- Provide Diagnostics
- Show Code Completion Proposals
- Show Hovers
- Help With Function and Method Signatures
- Show Definitions of a Symbol
- Find All References to a Symbol
- Highlight All Occurrences of a Symbol in a Document
- Show all Symbol Definitions Within a Document
- Show all Symbol Definitions in Folder
- Possible Actions on Errors or Warnings
- Rename Symbols
Drag[en]gine Game Engine DragonScript Module
This extension supports the Drag[en]gine Game Engine. The installed DragonScript Modules
are automatically detected and the latest module version used if the workspace requires
Drag[en]gine. To enable this support see the extension parameter
dragonscriptLanguage.requiresPackageDragengine.
Preview Images


Requirements
To edit DragonScript no additional requirements are required.
To edit Drag[en]gine projects using the DragonScript Script Module the Drag[en]gine Game Engine
is required to be installed for this extension to find and load the Drag[en]gine packages.
Extension Settings
dragonscriptLanguage.pathDragengine:
String type value containing the path to Drag[en]gine installation.
Use empty string to auto-detect (default). Set this path if the Drag[en]gine
Game Engine is not installed in the default path.
It is recommended to set this value on global level.
dragonscriptLanguage.scriptVersion:
String type value specifying the Drag[en]gine DragonScript version to validate
against (e.g. 1.33). Use empty string to use the latest available version (default).
If the version is not found in the local Drag[en]gine installation it is downloaded
from the online release repository. The version can also be detected automatically
from the Drag[en]gine project file (.degp) if present in or above the workspace
directory.
It is recommended to set this value on workspace level.
dragonscriptLanguage.requiresPackageDragengine:
Boolean type value indicating if the workspace requires Drag[en]gine DragonScript Module Package.
By default this is disabled.
Enable this parameter on workspace level for scripts using the Drag[en]gine Game Engine.
dragonscriptLanguage.scriptDirectories:
List of directories (strings) to scan for source files. Typically scripts are located in one
directory (default workspace root). Use empty list to disabled DragonScript support for workspace
or specific directory. The default value is ['.'] scanning the entire workspace directory for
source files.
Set this parameter on workspace or directory level. If set on directory level you can disable
source file scanning on a per directory basis, for example for data directories containing
no source code.
dragonscriptLanguage.basePackages:
List of base packages. If an entry is a directory it is scanned for .ds files. If the entry is
a DELGA file (.delga) it is scanned for .ds files. The default value is [].
Base packages allow creating projects based on other projects. The requiresPackageDragengine
is such a base package which has a separate parameter. Typically this list contains the .delga
file of the base game or application project.
Set this parameter on workspace or directory level. If set on directory level you can disable
base packages on a per directory basis, for example for data directories containing no source code.
dragonscriptLanguage.enableSemanticHighlightingOverrides:
Enables semantic highlighting overrides. This adds underline to variables written to and
strike-through to deprecated elements.
Enabled by default since VSCode does not provide these useful clues in the default themes.
Disable this setting if you use a theme supporting semantic modifiers or if you want to use
custom theme overrides for semantic modifiers.
Changing this setting takes effect only after restarting/reloading VSCode.
Support
Report issues to https://github.com/LordOfDragons/vscode-langext-dragonscript/issues
or join the Discord channel to ask for help.
Release Notes
2.6.2
- Fixed potential server crash on Windows if delga cache can not be deleted.
2.6.1
- Improved and added more File New templates
2.6.0
- Added new setting
dragonscriptLanguage.scriptVersion to specify the Drag[en]gine
DragonScript version to validate against (e.g. 1.33) or empty string to use the
latest available version. Documentation is retrieved from local Drag[en]gine installation
if available otherwise downloaded from the online documentation storage.
- Added automatic detection of the required DragonScript version from the Drag[en]gine
project file (
.degp) located in the workspace directory or a parent directory.
Settings script version overrules project script version if explicitely set.
- Added language status bar items (visible in the editor status bar for
.ds files):
- Project Script Version: DragonScript version required by the project (from
.degp)
- Editor Script Version: DragonScript version used for validation
2.5.0
- Added "File -> New..." menu entry "DragonScript Template File" to create new DragonScript
files from templates. Templates available:
- Game: Drag[en]gine game application class (
BaseGameApp subclass)
- Game Loader: Drag[en]gine game loader class (
WindowGameWorld.Loader subclass)
- Behavior: Drag[en]gine element class behavior (
DefaultECBehavior subclass)
- Behavior (BT/SM): Drag[en]gine element class behavior with behavior tree and
state machine support (
DefaultECBehavior subclass with ECComposeBTSM)
- Fixed type completion inserting superfluous pins
- Fixed line splicing breaking semantic token contexts
- Added missing
\ref highlight in doxygen comments
- Fixed single line comments not highlighted in all situations
- Fixed doxygen auto-brief first line spilling over into code if no period at end of line
- Fixed
new function call not highlighting as keyword
- Improved compatibility with non-VSCode LSP clients
- Hardening of LSP server against client not supporting
globalStoragePath
- Hardening against file system failures
- Added support for Haiku OS
2.4.0
- Added theme override to underline written to variables and deprecated elements.
Can be disabled if the uses does not want to use this
- Added support for generating semantic tokens
- Improved TextMate grammer file
- Workaround for handling files contained in delga by vscode by unpacking them into
a temporary directory (delga/deal caching)
2.3.0
- All XML Schemas used by Drag[en]gine added.
2.2.5
- Added support to register various XML Schemas used by Drag[en]gine.
2.2.0
- Potential fix for code scanning alert no. 2: Inefficient regular expression
- Added support to find game engine scripts in deal files. Required for
Drag[en]gine 1.26.1 and never
- Fixed override function completion not qualifying arguments if colliding with type
of same name. For example if overriding a function "void onEvent(Instance instance)"
in a class where in a parent class something is named "Instance" now qualifying the
"Instance" type would use the wrong type and no overriding would happen. This fix
avoids this subtle kind of mistake that could otherwise be only noticed by looking
at the hover information (override information would be missing)
2.1.0
Various bug fixes, hardenings and these improvements:
- Added support for defining base packages. Base packages allow referencing installed
game or application projects. This is useful to write modifications or extensions
for applications. Base packages can be either an directory with source code or a
.delga file. Delga files is the typical use case. See the new setting
dragonscript.basePackages. For Delga files only the documentation is shown.
Source code is not shown to protect copyrights of installed applications.
- Added support for functions without documentation to inherit the base class function
documentation. Travels up the inheritance chain until a function with documentation
is found.
- Added support for functions to show their inheritance chain in the hover information
panel. Includes all parent functions overwriting base class functions, the base class
function itself and the interface function if applicable. Class and function are
hyperlinked individually for easy navigation.
- Improved the "\ref tag" documentation parsing to support more situations.
- Added icon for .ds files.
2.0.0
Release with language server support:
- Provide Diagnostics
- Show Code Completion Proposals
- Show Hovers
- Help With Function and Method Signatures
- Show Definitions of a Symbol
- Find All References to a Symbol
- Highlight All Occurrences of a Symbol in a Document
- Show all Symbol Definitions Within a Document
- Show all Symbol Definitions in Folder
- Possible Actions on Errors or Warnings
- Rename Symbols
Added support to detect and use installed Drag[en]gine Game Engine DragonScript modules
1.0.0
Initial release with support for syntax highlighting without language server.