qorelanguage / qore-vscode

Qore language extension for Visual Studio Code
MIT License
1 stars 2 forks source link
language-extensions qore qore-vscode syntax-highlighting vscode vscode-extension

qore-vscode

qore-vscode is an extension for Visual Studio Code adding Qore language support.

Version 0.8.4 (2023-11-18)

Version 0.8.3 (2023-11-15)

Version 0.8.2 (2023-06-26)

Version 0.8.1 (2023-06-06)

Version 0.8.0 (2023-05-25)

Version 0.7.7 (2022-05-10)

Version 0.7.6 (2022-05-10)

Dependencies

Qore 0.9.3+ has to be installed, including the qdbg-vsc-adapter, for all the functionality including the debugging support to work.

Qore 0.8.13+ has to be installed, including the astparser and json modules, for all the functionality to work except the debugging.

On Windows and macOS, if you don't have Qore installed, a warning message will be shown when the extension is activated asking you if you want to download the Qore VSCode package. If you select "Yes", a Qore package will be downloaded and installed into the extension directory. This will provide Qore and necessary modules for the Qore Language Server to run.

Features

This extension adds support for the following:

Most of the features (except syntax highlighting) are provided by QLS (Qore Language Server). In order for QLS to function properly you need to have Qore 0.8.13+ installed on your system, including the astparser and json modules.

QLS Logging

If you want to log output of QLS, you can use the following configuration settings:

Debugging

The sessions are configured in launch.json file referenced from Debug view. The extension implements qore debugging type. Debugger can execute Qore script in local debug host or attach to a remote qdbg-server host.

In the first case the request value is launch and program specifies Qore script filename. In latter case the request value is attach and connection specifies URL to connect to and program is program name to be debugged.

Note that VSCode macros and commands are expanded. The extension implements ${command:AskForFilename} for launch case and ${command:AskForConnection}, ${command:AskForProgram} for attach case to specify value when debugging session is started.

To start debugging prepare launch file, select a configuration from drop-down menu and click Start debugging. When specified program is executed the extension is notified, the program interrupted and then user can start stepping the code, inspecting stack, variables, etc. To leave program stepping press F5.

The launch file data structure is explained by the following example:

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "qore",
            "request": "launch",
            "name": "Ask for file name",
            "program": "${workspaceFolder}/${command:AskForFilename}"
        },
        {
            "type": "qore",
            "request": "attach",
            "name": "Ask for conection and program",
            "connection": "${command:AskForConnection}",
            "program": "${command:AskForProgram}"
        },
        {
            "type": "qore",
            "request": "launch",
            "name": "Launch test-basic.q",
            "program": "test-basic.q",
        },
        {
            "type": "qore",
            "request": "attach",
            "name": "Attach test-program",
            "connection": "ws://localhost:8001",
            "program": "test-program",
        }
    ]
}