nrf-connect app with west workspace vscode configuration.

Hi.

We have an application (nrf connect 2.7.0). the applications is based on sys build and is encapsulated in a west workspace.

so the app folder includes west.yml, app folder with the app CmakeList.txt and driver directory etc...

Much like the example for the very same structure in here : https://github.com/nrfconnect/ncs-example-application there is no .vscode/settings.json file in the repo, also i have added it to .gitignore.

I was sure west init will take care of it, though it doesn't.

So after west init && west update and

cd my-app-in_west_ws
code .

the vscode identifies the workspace and nrf-connect sdk version, but not the app, i can't add build configuration, even though it's a standalone app.

The only thing i can do is manually add a workspace config file.

I was sure the nrf-connect plugin will have some automatic way to do it, am i missing something ?

  • I am using NCS v2.7.0, and the pre-release version of the nRF Connect VS Code extension, yes.

    For reference, this is my workspace structure:

    Do you see any major differences compared to yours?

  • thanks Heiu, it looks very much like my setup and in addition the fact that we are using the same version of the extension and the SDK makes it even stranger, i'll try today again with a fresh workspace from the example. If it wont work i'll try inside a vritual machine with a fresh install of VScode, you say it i open the app folder then the .vscode/settings.json should be created automatically, correct ?
    And if not but i use "open existing application" and open for instance the folder ncs-example-application and it should generate it as well, correct ?

  • Eyal_Gal said:
    you say it i open the app folder then the .vscode/settings.json should be created automatically, correct ?

    No, only when you take an action that changes settings would that file be created.

    See visual studio code - How to create and init ".vscode" in VSCode? - Stack Overflow

  • ah. that explains it, so yeah like i said eventually i created an "action" that caused it to create, i use the command to edit it...
    but for adding: "nrf-connect.applications": ["${workspaceFolder}/app"] i had to look in an automatically created app imported from examples.

    I think there should be for the very least an automated action that will add folder X (app in this case) as an application and will add it to the settings, especially for west workspaces.

  • Eyal_Gal said:

    ah. that explains it, so yeah like i said eventually i created an "action" that caused it to create, i use the command to edit it...
    but for adding: "nrf-connect.applications": ["${workspaceFolder}/app"] i had to look in an automatically created app imported from examples.

    I think there should be for the very least an automated action that will add folder X (app in this case) as an application and will add it to the settings, especially for west workspaces.

    Hm, I am not clear what kind of feature you require here.

    If you open a directory that has the files necessary for a Zephyr application, the extension should be able to automatically detect the directory as containing an application and put it under the Application panel.

    The setting "nrf-connect.applications": ["${workspaceFolder}/app"] is only relevant when you add more applications.

    If you expect the extension to parse recursively into the folder and detect all applications, I am not sure that would work well with the nature of Zephyr. Within Zephyr are tens if not hundreds of samples, demo applications, and test applications.

Related