Limitations in vscode development environment

Hi all,

since vscode plugin for scilab is available, I enjoy to use it often, mainly to debug scripts that are handling complex objects derived from list. The vscode interface’s friendlyness helps to trigger the issue way faster than in usual environment.
Whenever the vscode’s is really supporting the writing, modern and confortable, I’m not using it systematically because:

  • at the very beginning development of new code, when ‘checking/debuging’ line after line manually in the console, I can’t extensively analyse the content variables of native scilab types (array of doubles, strings, ints, etc…) as with editvar() from usual environment, only a summary in vscode variable explorer
  • the execution of a script from VScode environment is at least ~20% slower than from original scilab development environment, whatever running in debug or without debug . This also prevent of using it in production mode when dealing with large dataset.

To compare the execution’s speed, I ran the following data processing script (import data and visualize processed data in graphic plots) in usual scilab environment then in vscode without debug

tic;
repchem= "C:\Users\elemexport";
S= listfiles(repchem+"\*.h5");
visufich= basename(S);

mprintf("t1=%f s\n",toc());

FOdw = importDWh5(S([5 4 3]));
mprintf("t2=%f s\n",toc());
visuApplFO(FOdw);
mprintf("t3=%f s\n",toc());
FOdw = importDWh5(S([2 1]),FOdw);
nmcoll=[]; for e=FOdw, nmcoll=[nmcoll;e.apptype]; end , clear e
visuApplFO(FOdw,[4 5]);
min(FOdw(5).I); 
max(FOdw(5).I);

mprintf("t4=%f s\n",toc()); 

which led to a matrix with execution time (in s) in columns (first one is usual env times, second is vscode w/o debug):

m=[0.000413 0.002061	
3.152338 3.399108	
8.175625 10.631719	
11.988046 15.025162	]

diff(m, 1, 'c')./m(:,1)

ans = [4x1 double]
3.9903148
0.0782816
0.3004167
0.2533454

Any tips to bring the execution from vscode down to the one when run from usual dev environment and how to inspect actual detailed content of variable ?

Thank you,

David

Hi David,

I pushed version 1.0.4, which should resolve the performance issue between debug and non-debug modes.

I understand your second request about the display of variables in VS Code.
When debugging, Scilab sends variables to VS Code at every execution stop. This can lead to lag if Scilab doesn’t reduce variables contents sent.
I’ll try to find a way to let you see the whole content of the selected variables.
For now, you can display them in the debug console, copy and paste values in a new VS Code tab.

Thanks for your feedback!

Cédric

1 Like

I have found no easy way to do that, so I have created an issue on the GitLab project:

Hello,

I find myself using VS Code with Copilot more and more often to develop my Scilab calculation and processing scripts. I agree with davcheze’s point about whether or not to use VS Code exclusively.

I often keep the classic IDE open alongside VS Code to be able to quickly run certain commands in the console without having to restart the entire script, especially when I’m dealing with processes that take several minutes to compute. The same goes for when I start a script from scratch; the classic IDE’s integrated help is a real bonus for me. I don’t know all the commands by heart, but when I need a command for string manipulation, I can find it quickly with the help feature. This is something I don’t have with VS Code.

Will it be possible to have the same type of integrated help in the future, as well as an always-open console that doesn’t require entering debug mode?

1 Like

Hello,

I completely agree with Philippe. In fact I have never started “seriously” to use the Scilab VSCode extension (despite the numerous features it has, that the classical Scilab Gui does not have) because I miss an “always-open console”, e.g. like the one the Julia VSCode extension has.

1 Like

Hello,

I have pushed a new version (2026.0.2) that allows you to open a full variable in a dedicated tab in VS Code.

This feature is available when a debug session is stopped by right-clicking on a variable (or a watch) and selecting `Open variable content`.

Variables can be opened in two formats:

* Scilab: the content is generated by `sci2exp`.

* JSON: the content is generated by `toJSON`.

The content of the new tab opened is stored “in memory”, which means the content cannot be reloaded after VSCode restart.

But you can change the content and save it by using the `Save` (Ctrl+S) feature. This action will reload the content of the variable in the Scilab of the current debug session.

If you want to keep it persistent over VSCode restarts, you can use the “Save As” (Ctrl+Shift+S) feature to save it on the disk. Doing so, you will lose the “reload” feature since the “in memory” tab becomes a common file that you can load in Scilab using the `exec` command or `fromJSON`, depending on the format.

With this version, the Scilab documentation is now available using F1 or a right click, then `Open Scilab documentation` on a Scilab file. When using the right click on a word or a selected area, the documentation will be opened using this information.

About the always-open console, I have opened an issue to keep tracking the request: always-open console (#17) · Issues · scilab / forge / vscode_extension · GitLab

Thanks to all for your feedback!

2 Likes

Hi Cédric,

first attempts are looking good for all new features of the vscode scilab plugin (editing and saving variable from Scilab base types (like real, integer, string, character, complex), scilab help from the higlighted code of the function or object) , thank you !

Maybe good to add some checks about the variable that is requested to edit before actually editing: when it’s a complex object, not scilab base types but structs, lists, timeseries, tables etc… it should suggest to look further in the VARIABLES tab, up to the end of the branch, rather editing a terminal leave of Scilab base type.

David

Hi Cédric,

I just started to develop new application including the new classdef Object in Scilab features, and I noticed that the VScode plugin, in text edition mode, doesn’t manage to retrieve in the outline tab view the functions defined within the methods block, annoying…! However the syntax higlighting feature in code tab is able to identify the corresponding string when I move the cursor on it.

In run/debug mode , in the variables tab I’m surprised that one can’t unfold the instance Tests of the object (from call to the creator of classdef RpHbeaTests ).

In addition , as in previous comment, I feel the Open variable content should not be available from the contextual menu for the variables of ‘complex type’ like classdef object.

Than you for your comment,

David

Hi David,

Regarding the variable content feature, I am unable to determine which variable makes the feature available or not. The only way is to open a new tab with content such as “not managed”. That’s why I prefer to keep the output of sci2exp for containers, even if this is not perfect.

Classdef is new, so not all features are available yet in VS Code, and some issues might be discovered.

Thank you for all your feedback, it’s really helping. As you already do, opening issues in the Scilab or the VSCode project is the best way to report issues and wishes :slight_smile: