# Scilab with VSCode

**URL:** <https://scilab.discourse.group/t/scilab-with-vscode/647>\
**Category:** Development\
**Created:** [September 21, 2024, 2:49am UTC](https://scilab.discourse.group/t/scilab-with-vscode/647 "2024-09-21T02:49:31Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vimsrocz](https://avatars.discourse-cdn.com/v4/letter/v/ed8c4c/32.png) [@Vimsrocz](https://scilab.discourse.group/u/Vimsrocz)\
**Post date:** [September 21, 2024, 2:49am UTC](https://scilab.discourse.group/t/scilab-with-vscode/647/1 "2024-09-21T02:49:31Z")

</div>

There is an issue with the configuration. Whenever I run the scilab script then new Scilab windows pop up but old open up is not executed. How to stop it?

How to work with vs code ? Any tutorial for scilab?

```auto
`{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "Run Scilab Script",
            "type": "shell",
            "command": "\"C:\\Program Files\\scilab-2024.0.0\\bin\\scilab-cli.exe\"",
            "args": [
                "-f",
                "${workspaceFolder}\\spacecraft-gnc-tbx-devel-kalman-filter-block\\builder.sce"
            ],
            "options": {
                "cwd": "${workspaceFolder}\\spacecraft-gnc-tbx-devel-kalman-filter-block"
            },
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "problemMatcher": [],
            "detail": "Run Scilab script using scilab-cli.exe"
        },
        {
            "label": "New Task",
            "type": "shell",
            "command": "echo 'Hello, World!'",
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "problemMatcher": []
        },
        {
            "label": "New Task",
            "type": "shell",
            "command": "echo 'Hello, World!'",
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "problemMatcher": []
        }
    ]
}`

```

---

<div class="post-metadata">

**Author:** ![vincent.couvert](https://avatars.discourse-cdn.com/v4/letter/v/f4b2a3/32.png) [@vincent.couvert](https://scilab.discourse.group/u/vincent.couvert)\
**Post date:** [September 23, 2024, 7:00am UTC](https://scilab.discourse.group/t/scilab-with-vscode/647/2 "2024-09-23T07:00:19Z")

</div>

Hello,

You have to add “-quit” to “args”.

Best regards.

---

<div class="post-metadata">

**Author:** ![Vimsrocz](https://avatars.discourse-cdn.com/v4/letter/v/ed8c4c/32.png) [@Vimsrocz](https://scilab.discourse.group/u/Vimsrocz)\
**Post date:** [September 23, 2024, 9:35am UTC](https://scilab.discourse.group/t/scilab-with-vscode/647/3 "2024-09-23T09:35:37Z")

</div>

Can you please tell me at which positions``?

```json
{
  "version": "2.0.0",
  "tasks": [
    {
      "label": "Run Scilab Script",
      "type": "shell",
      "command": "\"C:\\Program Files\\scilab-2024.0.0\bin\\scilab-cli.exe\"",
      "args": [
        "-f",
        "${workspaceFolder}\\spacecraft-gnc-tbx-devel-kalman-filter-block\builder.sce"
      ],
      "options": {
        "cwd": "${workspaceFolder}\\spacecraft-gnc-tbx-devel-kalman-filter-block"
      },
      "group": {
        "kind": "build",
        "isDefault": true
      },
      "problemMatcher": [],
      "detail": "Run Scilab script using scilab-cli.exe"
    },
    {
      "label": "New Task",
      "type": "shell",
      "command": "echo 'Hello, World!'",
      "group": {
        "kind": "build",
        "isDefault": true
      },
      "problemMatcher": []
    },
    {
      "label": "New Task",
      "type": "shell",
      "command": "echo 'Hello, World!'",
      "group": {
        "kind": "build",
        "isDefault": true
      },
      "problemMatcher": []
    }
  ]
}

```

---

<div class="post-metadata">

**Author:** ![mottelet](https://yyz2.discourse-cdn.com/free1/user_avatar/scilab.discourse.group/mottelet/32/13_2.png) [@mottelet](https://scilab.discourse.group/u/mottelet)\
**Post date:** [September 23, 2024, 9:53am UTC](https://scilab.discourse.group/t/scilab-with-vscode/647/4 "2024-09-23T09:53:35Z")

</div>

Add it like this

```auto
      "args": [
        "-quit",
        "-f",
        "${workspaceFolder}\\spacecraft-gnc-tbx-devel-kalman-filter-block\builder.sce"
      ]

```

S.

---

<div class="post-metadata">

**Author:** ![antoine.elias](https://yyz2.discourse-cdn.com/free1/user_avatar/scilab.discourse.group/antoine.elias/32/16_2.png) [@antoine.elias](https://scilab.discourse.group/u/antoine.elias)\
**Post date:** [September 23, 2024, 10:05am UTC](https://scilab.discourse.group/t/scilab-with-vscode/647/5 "2024-09-23T10:05:02Z")

</div>

Hello,

Your executable name is wrong

- _scilex.exe_ to java/gui/xcos **disable**
- _wscilex-cli.exe_ to java/gui/xcos **enable** but without graphical console.
- _wscilex.exe_ to **enable** all features and graphical console.

In your case, I guess you want to use **wscilex-cli.exe**

---

<div class="post-metadata">

**Author:** ![cedric.delamarre](https://avatars.discourse-cdn.com/v4/letter/c/49beb7/32.png) [@cedric.delamarre](https://scilab.discourse.group/u/cedric.delamarre)\
**Post date:** [January 29, 2025, 11:10am UTC](https://scilab.discourse.group/t/scilab-with-vscode/647/6 "2025-01-29T11:10:43Z")

</div>

Hi,

We release the first version of the Scilab Extension for VS Code.  
You can find it on the [VS Code marketplace](https://marketplace.visualstudio.com/items?itemName=scilab.scilab) or in VS Code under **Scilab Language Support**.  
You must install the new release of [Scilab 2025.0.0](https://www.scilab.org/download/scilab-2025.0.0) to use it.

Here are the kinds of **task.json** and **launch.json** I’m using to build, load, and execute a file used to develop a toolbox:

task.json:

```auto
{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "build toolbox",
            "type": "shell",
            "command": "C:\\PROGRA~1\\scilab-2025.0.0\\bin\\WScilex-cli.exe",
            "args": ["-f", "builder.sce", "-quit"],
            "problemMatcher": []
        }
    ]
}

```

launch.json

```auto
{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "scilab",
            "request": "launch",
            "name": "build & load & current",
            "file": "${file}",
            "workingDirectory": "${workspaceFolder}",
            "keepAlive": true,
            "args": ["-f", "${workspaceFolder}/loader.sce"],
            "preLaunchTask": "build toolbox"
        }
    ]
}

```

When starting a debug session, this configuration will:

1. Build the toolbox using the defined task: _“preLaunchTask”: “build toolbox”_
2. Launch Scilab and load the toolbox: _“args”: [“-f”, “${workspaceFolder}/loader.sce”]_
3. Execute the current opened file in VS Code with the debugger: _“file”: “${file}”_
4. Keep the debug session alive when the execution is done: _“keepAlive”: true_

Feel free to let us know if this fits your needs 🙂
