Visual Studio Code status bar changed

My status bar (along the window bottom) no longer shows items like particle device or OS for my particle project. So I can not select my device or OS. (see screen capture below). Occasionally it switches back to the old layout but I can not figure out what causes that. Probably one of the 10 trillion settings in Visual Studio Code (v1.82.2). After spending several hours searching for a fix I decided to post here. Probably something simple but ... Any pointers would be appreciated.

It seems VS Code thinks the code you are working on is for some other platform (Win32) and doesn't recognize it as Particle project.
How did you open the project?
What do the files in the .vscode directory say about the project?

Thanks for getting back to me.
I brought the project code in from a repository on github by adding a folder to an existing workspace, which had been working fine.
Is there a way to tell VS Code that this is a Particle project?
I exited VS Code and reopened the project workspace. That brought back the normal Particle status bar but after working on the project for a while it went back to the weird status bar. I'm doing something wrong, just can't figure out what.
The .vscode directory has files launch.json and settings.json containing a good bit of text. Here they are below:
launch.json

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "cortex-debug",
            "request": "attach",
            "servertype": "openocd",
            "name": "Particle Debugger",
            "cwd": "${workspaceRoot}",
            "rtos": "FreeRTOS",
            "armToolchainPath": "${command:particle.getDebuggerCompilerDir}",
            "executable": "${command:particle.getDebuggerExecutable}",
            "serverpath": "${command:particle.getDebuggerOpenocdPath}",
            "preLaunchTask": "Particle: Flash application for debug (local)",
            "searchDir": [
                "${command:particle.getDebuggerSearchDir}"
            ],
            "configFiles": [
                "${command:particle.getDebuggerConfigFiles}"
            ],
            "postAttachCommands": [
                "${command:particle.getDebuggerPostAttachCommands}"
            ],
            "particle": {
                "version": "1.0.1",
                "debugger": "particle-debugger"
            }
        },
        {
            "type": "cortex-debug",
            "request": "attach",
            "servertype": "openocd",
            "name": "Particle Programmer Shield",
            "cwd": "${workspaceRoot}",
            "rtos": "FreeRTOS",
            "armToolchainPath": "${command:particle.getDebuggerCompilerDir}",
            "executable": "${command:particle.getDebuggerExecutable}",
            "serverpath": "${command:particle.getDebuggerOpenocdPath}",
            "preLaunchTask": "Particle: Flash application for debug (local)",
            "searchDir": [
                "${command:particle.getDebuggerSearchDir}"
            ],
            "configFiles": [
                "${command:particle.getDebuggerConfigFiles}"
            ],
            "postAttachCommands": [
                "${command:particle.getDebuggerPostAttachCommands}"
            ],
            "particle": {
                "version": "1.0.1",
                "debugger": "particle-programmer-shield"
            }
        },
        {
            "type": "cortex-debug",
            "request": "attach",
            "servertype": "openocd",
            "name": "Generic DAPLink Compatible Debugger",
            "cwd": "${workspaceRoot}",
            "rtos": "FreeRTOS",
            "armToolchainPath": "${command:particle.getDebuggerCompilerDir}",
            "executable": "${command:particle.getDebuggerExecutable}",
            "serverpath": "${command:particle.getDebuggerOpenocdPath}",
            "preLaunchTask": "Particle: Flash application for debug (local)",
            "searchDir": [
                "${command:particle.getDebuggerSearchDir}"
            ],
            "configFiles": [
                "${command:particle.getDebuggerConfigFiles}"
            ],
            "postAttachCommands": [
                "${command:particle.getDebuggerPostAttachCommands}"
            ],
            "particle": {
                "version": "1.0.1",
                "debugger": "generic-cmsis-dap"
            }
        },
        {
            "cwd": "${workspaceRoot}",
            "executable": "./bin/executable.elf",
            "name": "Debug Microcontroller",
            "request": "launch",
            "type": "cortex-debug",
            "servertype": "openocd"
        },
        {
            "name": "(lldb) Launch",
            "type": "cppdbg",
            "request": "launch",
            "program": "enter program name, for example ${workspaceFolder}/a.out",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": false,
            "MIMode": "lldb"
        }
    ]
}

and settings.json

{
    "C_Cpp.default.configurationProvider": "particle.particle-vscode-core",
    "particle.targetPlatform": "boron",
    "particle.targetDevice": "Spudnik-41",
    "files.associations": {
        "array": "cpp",
        "string": "cpp"
    },
    "particle.firmwareVersion": "4.2.0",
    "cmake.configureOnOpen": true
}

If you added a Particle project into an existing Workspace, you now have a multi-root workspace. These are sort of supported, but may work unexpectedly.

We recommend that you open the Particle project, the directory containing the project.properties, in its own VS Code window. This will provide the most seamless experience.

If you do want to use a multi-root workspace, the inner Particle project must contain a project.properties file. It's also recommended that the source files be in the src directory within that directory.

When you have a multi-root workspace, the current project is not determined by the window you have open. This is the most confusing part. You will be prompted for which project to build when it is ambiguous. Because the current project is ambiguous, the toolbar may not match the window you have open as well.

2 Likes

Thanks for the info. At least now I know what is wrong.
I've been using a multiple project workspace for a while now and like it, so I'll use the info you provided to try to make it work right. All my projects in the workspace have a project.properties file and code is in the src directory. If I can't get it to work consistently I'll move to single projects per workspace like you suggest. Thanks, john