Ciao Prolog Language Support for Visual Studio Code
This extension enhances Visual Studio Code with robust language support for Ciao Prolog, making it easier to write, edit, and debug Ciao Prolog code.
Table of Contents
To use this extension on Windows, follow these steps, which include setting up Windows Subsystem for Linux (WSL):
Installation (Linux and macOS)
On Linux and macOS, you can install this extension and Ciao Prolog directly in Visual Studio Code without the need for additional setup.
Installing Ciao Prolog from Visual Studio Code
The extension provides comprehensive syntax highlighting for Ciao Prolog. It also offers the ability to override color rules with official Ciao Prolog syntax coloring rules using a certain command. For more information on customizing syntax highlighting, see customizing syntax highlighting.
The extension includes a collection of predefined code snippets to help users insert common code structures in Ciao Prolog files. This feature speeds up coding by allowing users to quickly insert templates for common patterns.
The extension includes various language configuration features for enhanced editing and coding experiences:
Ciao Top Level
The extension introduces an integrated Ciao Top Level within the Visual Studio Code window. It allows you to interact with the Ciao Prolog interpreter, providing advanced features and control, including syntax coloring, debugging, and more.
Sending Commands to the Top Level
Users can send the most useful commands to the Ciao Top Level by clicking on a series of special buttons that are available when focused on a Ciao Prolog file.
Note: All this buttons are associated with its corresponding command that is also available using the Visual Studio Code Command Palette
Also, there exist many other commands that are not available via buttons and must be used by invoking commands available in the Visual Studio Code Command Palette. Some of the available commands include:
For a quick guide to interact with the Visual Studio Code Command Palette, see working with the command palette
For a complete list of the Ciao Top Level commands, please check out the
Marking Errors on Source
When you load a module into the Ciao Top Level, the extension automatically marks errors detected in the process. Warnings are displayed with a yellow wavy underline, and errors are displayed with a red wavy underline.
These diagnostics also include a brief explanation of the problem that was found.
This VSCode extension enhances your coding experience by providing real-time verification and/or linting as you type Ciao Prolog Code. Which will help you find possible errors and warnings as you are coding!
See configure verifly.
Generating and Displaying Documentation
The extension supports generating and displaying documentation using LPdoc, the documentation generator for Ciao Prolog. Users can generate and access preliminary documentation in a temporary directory before deciding to generate it in the current working directory.
Opening the Current File in the Ciao Playground
With a simple command, you can open the current Ciao Prolog file in a Ciao Playground tab in your web browser. This feature allows for convenient editing and sharing of code. Please note that there is a maximum URL length (2048 in the worst case), and files exceeding this length will show an error message. For details on using this feature.
When debugging a Ciao Prolog file, every step taken by the debugger is marked with a blue line in the source code. This visual indication helps users track the debugger's progress and location. For more on using the source debugger.
These features make the Ciao Prolog Language Support extension a powerful tool for developing Ciao Prolog applications in Visual Studio Code. To learn more about each feature, refer to the respective sections linked above.
Working with the Command Palette
The natural and more convenient way to work with this extension is by using the Visual Studio Code command palette.
To access the Command Palette in Visual Studio Code and select extension commands, follow these simple steps:
This simple process allows you to quickly access and use the various commands provided by the Ciao Prolog Language Support extension within Visual Studio Code.
Customizing Syntax Highlighting
By default, the syntax coloring of Ciao Prolog Files follow the coloring rules of the current Visual Studio Code editor theme.
However, if you want to use the official Ciao Prolog coloring rules, you can activate them by following these steps:
In case you want to disable them, just execute the command:
By default, verifly comes deactivated. You can activate it through Visual Studio Code Configuration as follows: