This extension provides spec macro script (
*.mac) support for Visual Studio Code.
This extension is not the official one developed by Certified Scientific Software.
Use GitHub issues for bug reports and feature requests about this extension.
spec is internationally recognized as the leading software for instrument control and data acquisition in X-ray diffraction experiments.
It is used at more than 200 synchrotrons, industrial laboratories, universities and research facilities around the globe.
cited from CSS - Certified Scientific Software homepage.
This extension supports the following features:
- Diagnostics - syntax check, still primitive
- Syntax highlight - colorizing symbols using a grammer
- IntelliSense - code completion and hinting
- Code completion proposals - autocompletion that works during a user types a symbol
- Help with function signatures - help that appears during a user types an argument in a function call.
- Code navigation
- Show all symbol definitions within a document - symbol definitions in a file, used in: Go to Symbol in File (Ctrl+Shift+O) and the navigation bar below the editor tabs
- Show definitions of a symbol - symbol definitions in open files, used in: Go to Definition (F12) and Peek Definition (Alt+F12) in right-click menu
These features cover both user-defined symbols and built-in symbols.
Built-in symbols cover variables, constants, functions, macros and some other keywords.
User-defined symbols cover functions and macros; currently variables are outside the scope.
User-defined symbols are scanned from open documents and optionally in files in the workspace.
This extension was developed with reference to the recent official PDF document about spec release 6 (version 3 of the spec documentation, printed 16 July 2017).
The extension assumes UTF-8 as the file encoding in workspace scan, regardless of user settings or selection in current editor.
This does not mean the developer garantees UTF-8 characters are safe for spec interpreters.
This extention contributes the follwing settings:
- controls the volume of explanatory text shown by IntelliSense features.
- registers information about the motor mnemonics, which enables IntelliSense features for
spec.mnemonics.motor.labels: a string array of the motor mnemonic, for example,
["th", "tth", "phi"]
spec.mnemonics.motor.descriptions: a string array of the descripive text of the motor mnemonic, for example,
["theta", "2 theta"]. This property is optional; its array length needs not be equal to that of
- enable/disable scanning and diagnostics of files in workspace.
One can find the settings in Extension / spec in the Settings window.
Read Visual Studio Code User and Workspace Settings if one has difficulty in setting them.
This extension is still beta and the identifiers (dot-separated string) of these settings may be changed in future releases.
- Currently the syntax diagnostics covers limited parts of the grammar and its error message is primitive.
- Statement continuation by putting a backslash at the end of the line is not supported.
Also read GitHub issues.