vscode-escript
SetupThis extension requires no additional software, as POL's Escript analytics are included in the extension. Project setupAfter installing the extension, open a POL distribution via "Open Folder".
Ensure that the folder selected contains Extension ConfigurationThe extension contains various options that alter the behavior of its analytics, documentation features, and other behaviors. Search for "Escript" inside the VSCode Preferences panel to find the current configuration options. Language FeaturesCode completionSuggestions will appear as you type names. Because vscode-escript uses POL's Escript parser parser, code completion has access to precise information of symbols, such as variables, module functions, and user functions. Compiler errors and warningsCode errors are shown as you type (both as red squiggle underlines, and in the "Problems" panel). These are the same as produced by the Escript compiler. Go to DefinitionThe extension provides support for "go to definition" for various symbols
(variables, constants, user and module functions) as well as jumping to the
definition of a module (specified in a Signature helpWhen typing Hover informationescript-vscode can describe almost any entity if you hover the mouse (or press Ctrl-KI). ReferencesThe extension can find references to symbols, such as variables (both locally- and globally-scoped), constants, user functions, and module functions across the entire workspace. FormattingThe extension provides support for both full-document as well as selection-based
formatting using the functionality provided by DebuggerPOL 100.2.0 includes a Debug Adapter Protocol (DAP) server which the vscode-escript extension can connect to for interactive debugging. New scripts can be launched, and already-running scripts can be attached to. The debugger supports the following features:
Launch ScriptExample launch configuration to run the current script in the Visual Studio Code editor:
Attach to ScriptExample launch configuration to attach to the current script in the Visual Studio Code editor, displaying a PID selection of multiple scripts found:
Tips and Tricks
Notes
Troubleshooting/bugsThe extension uses a built-in version of the Escript compiler, and may crash
when processing invalid sources (eg. when actively typing). Disabling the
extension option If the EScript Language Server crashes, it can be restarted by reloading the window (Command Palette > Developer: Reload Window). If you have excessively high memory usage (>400MB), this may be caused by the
use of the Workspace Cache for finding references across the entire workspace.
This feature can be disabled via setting the extension option
If you've found a bug in this extension, please file it at https://github.com/polserver/vscode-escript/issues. Running the Extension via Debugging
|