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.
During migration of my PCs, I deleted my Visual Studio Marketplace publisher account by mistake.
I recreated a new account with the same name (
fujidana) but it was not treated identically in the Marketplace.
Users of version 0.6 or earlier need to manually uninstall their version and install this version in order to receive future updates.
Sorry for inconvenience.
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
- Syntax highlighting - 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
- Commands - the following commands can be invoked from the command pallate (Ctrl+Shit+P):
- "Run Seclection/Line in Terminal" and "Run File in Terminal" commands. These commands expect spec interactive shell has been ready in the active terminal view.
- "Open Reference Manuall" command.
This extention treats user-defined symbols declared at the top level (i.e., not in a code block, curly brackets) as global and those in code blocks as local.
Global symbols are visible beyond a file where the symbol is defined; local symbols are visible only when the cursor is in the same block.
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 help text of built-in symbols are cited from this document.
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.
The spec grammar is torelant, lazy in other word.
It is difficult to perfectly mimic its behavior.
Instead, this extension requires stricter coding than the spec interpreters does.
For example, spec interpreters evaluate the following two lines equivalently:
but this extension shows an alert or error on the first line ("/" is the division operator and "." is not for any literal, symbols or operators.) because it expects explicit quotation marks for a string literal.
Also, inline-macro, as shown below, is not supported. The macro definition must consist of one or more sentenses.
def ifd 'if (DATAFILE != "" && DATAFILE != "/dev/null")'
ifd do_something; else do_otherthing;
This extention contributes the follwing settings:
vscode-spec.editor.hintVolume.* - controls the volume of explanatory text shown by IntelliSense features.
vscode-spec.mnemonic.* - registers information about the motor and counter mnemonics. IntelliSense feature treats them as defined symbols; motor mneomonics are also used in code snippents for
vscode-spec.workspace.* - controls the rule to scan files in workspace.
vscode-spec.command.filePathPrefixInTerminal - specifies file path prefix used in "Run File in Active Terminal" command.
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.
The identifiers (dot-separated string) of these settings have been changed in v1.0.0.
- Syntax check by this extension has small differences with actual spec interpreters.
- Statement continuation by putting a backslash at the end of the line is not supported in syntax highlighting.
Also read GitHub issues.