Code completion not working

Hi!

Scilab code completion/suggestions never worked on my setup, with it stuck at “starting”.
I tried reinstalling both VSCode and Scilab, but did not work. I dug around and found the following:

Tried to install different versions of the extension (1.0.0 - 1.0.5) but it still occurs.

Any idea how to fix? Thanks in advance!

Hi JD86, and welcome to the Scilab community :slight_smile:

I do not reproduce your error. Can you tell me if you have toolboxes already installed in Scilab, and if it is failing at any word you are writing?

Cédric

Hello, I don’t have any toolboxes installed, and VSCode mostly shows suggestions of words I’ve typed previously (variable names, functions) and the following, they work but the list ends there.

Autocompleting ‘function’ results to:
”function output = name(input)

// Description of name(input)

endfunction”

But trying to autocomplete ‘inttrap‘ shows “No suggestions.“

About the autocompletion for the word function, you can autocomplete using the keyword (first row in the next screenshot) or the snippet that will create the function structure (the last row in the next screenshot).
In your case, you had autocomplete using the snippet.

I have reproduced what you described one or two times; it seems the issue occurred at the startup of VS Code. Autocompletion is populated using a running Scilab instance in the background, which may not be ready when you request completion.
You can check the Scilab status in the bottom right of VS Code by clicking on the {}:

image

Have you experienced this issue after waiting for some seconds?

Can you give me the log of Scilab Language Server (as you do in your first message) and the log of Scilab Extention Logswhen the problem occurs?

I have used VSCode for hours many times and gets stuck here (wasn’t able to post screenshot the first time :sweat_smile:):

Here are the logs for the Language Server:

Scilab 2025.1.0 (May 22 2025, 12:21:05)
Scilab PID: 29336
Language Server and Debug Adapter Protocol loaded
at line 15 of executed file C:\Users\name\.vscode\extensions\scilab.scilab-1.0.5-win32-x64\toolbox\loader.sce

getPage: error on line #7: “Invalid index.”

And Extension Logs:

e[34m
Activate Scilab extension !
e[34m
Testing Scilab
e[34m
C:\Program Files\scilab-2025.1.0\bin\WScilex-cli.exe -e try, exec(“c:\Users\name\.vscode\extensions\scilab.scilab-1.0.5-win32-x64\toolbox\loader.sce”); catch, mfprintf(0, “%s\n”, lasterror()); exit(42); end; exit(0);
e[34m
Scilab 2025.1.0 (May 22 2025, 12:21:05)
e[34m
Scilab PID: 13516

e[34m
Language Server and Debug Adapter Protocol loaded

e[34m
Testing Scilab closed with status 0
e[34m
Launch LSP
e[32m
Port found: 59221
e[34m
State change from Stopped to Starting

Can you open Scilab (without VSCode) and execute those commands?

getlanguage()
getHelpPage("cos")

Here’s the result:

Thanks for the logs, I’ve reproduced your error and opened an issue: inline doc fails for non existing language documentation (#17479) · Issues · scilab / scilab · GitLab

What you can do for now is to use en_USas the default language in Scilab.
To do that, execute this command:setdefaultlanguage("en_US")

Let me know if it works :slight_smile:

Ran the command in SciLab (outside of VSCode) and ran VSCode, it now works:


Thank you! :blush: