NOTE: Other Zeus, D language specific features can be found here:
Using the dfmt with Zeus
Using the D Programming Language with Zeus
Using the DCD with Zeus
These are just some of the features this tool has to offer:
Syntax Check
The "--syntaxCheck" or "-s" option prints a listing of any errors or warnings found while lexing or parsing the given source file.
Style Check
The "--styleCheck" or "-S" option runs some basic static analysis checks against the given source files.
Find Declaration
The "--declaration" or "-d" options allow you to search for a symbols declaration.
Example of Using Find Declaration
Assume this file is open:
Code: Select all
Dscanner\astprinter.d
Code: Select all
override void visit(const AddExpression addExpression)
{
...
}
Code: Select all
.\libdparse\src\std\d\ast.d(371:13)
Code: Select all
final class AddExpression : ExpressionNode
To use the Dscanner from inside Zeus you will need to do the following:
1) Download the source code from the Dscanner home page.
2) Build the dscanner.exe and copy the executable to this folder (which will issure it is in the PATH):
3) Edit the D Document Type and in the Tools section add the three tool configurations described below.
Code: Select all
Menu Test: Syntax Check
Program Name: dscanner.exe
Arguments: --syntaxCheck "$fn"
Work Directory: $fdd
(o) Run Hidden
[x] Capture Standard Output
[x] Capture Standard Error
Code: Select all
Menu Test: Style Check
Program Name: dscanner.exe
Arguments: --styleCheck "$fn"
Work Directory: $fdd
(o) Run Hidden
[x] Capture Standard Output
[x] Capture Standard Error
Code: Select all
Menu Test: Find Declaration
Program Name: dscanner.exe
Arguments: --declaration $wex
Work Directory: $fdd
(o) Run Hidden
[x] Capture Standard Output
[x] Capture Standard Error
In the following post find details on how to wrap these calls to the Dscanner tool inside a Zeus macro.
By using a macro allows you to do things like configure Zeus to run these style checks each time the file is saved or to have these checks run using a keyboard key combination.