How can the "PaYC Generate options" called from a script

1 回表示 (過去 30 日間)
Horst Dreßel
Horst Dreßel 2025 年 7 月 10 日
回答済み: Horst Dreßel 2025 年 7 月 24 日
Hello,
in normal use case the PolyspaceAsYouCode build option would be generated in VSCode from menu "View->Command Palette->Polyspace.generateBuildOptions".
Is is possible to execute this step from a build script ?
  1 件のコメント
Pratyush Swain
Pratyush Swain 2025 年 7 月 17 日
Hi Horst,
If you want to specify build command in the build settings which the Polyspace will run while generating build options, you can refer to following section here: https://www.mathworks.com/help/polyspace_access/ug/generate-options-for-polyspace-as-you-code-analysis-in-visual-studio-code.html#mw_f02ffe3e-3a51-47ac-a842-df970c124ab6
Also it should be visible in the parameters of the plugin as follows:
But I get a feeling here, you have already got this part sorted and you actually want to automate the process of trigerring the 'Polyspace Generate Build Options' process for which you have to access the command palette everytime.
I think this may be helpful: https://code.visualstudio.com/api/extension-guides/command#programmatically-executing-a-command , VS Code has API's to programmatically execute command, maybe leverage the same to execute 'polyspace.generateBuildOptions'. It may be worth a try.
Will comment if I find any other workaround. Also can you tell your usecase/motivation behind perfoming 'generating build options' from script ?
Thanks

サインインしてコメントする。

回答 (1 件)

Horst Dreßel
Horst Dreßel 2025 年 7 月 24 日
Issue fixed.
Create a task in VSCode tasks.json which execute command polyspace.generateBuildOptions
{
"version": "2.0.0",
"tasks": [
{
"label": "run polyspace",
"type": "shell",
"command": "${input:test}",
"dependsOn": ["echo toto"]
},
{
"label": "echo toto",
"type": "shell",
"command": "echo Toto"
}
],
"inputs": [
{
"id": "test",
"type": "command",
"command": "polyspace.generateBuildOptions"
}
]
}

製品


リリース

R2024a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by