[ISSUE] WorkBench Intellisense "No Storage Class"


#1

Support Information:

  • VSCode Ver: 1.28.2
  • OS Versison: MacOS High Sierra 10.13.6
    Other Extensiosns
  • C++: 0.19.0
  • Cortex-Debug: 0.1.21
  • Particle Code Snippets: 1.0.0-alpha.3
  • Particle Themes: 1.0.0-alpha.3
  • Particle Workbench 1.0.0-alpha.3

Existing codebase uses “retained” variable declarations with no issues and builds/runs correctly under ParticleDev/Atom environment. Under VSCode environment, codebase builds, flashes and runs correctly. However in the Particle Workbench “Problems” tab, reports “this declaration has no storage class or type specifier” for all “retained” declared variables. Similar problem for “time_t” reports “not a type name”.


#2

Could it be that your build is targeting the Core?
Try to explicitly change the target platform.

This may be a related issue where the platform setting was not correctly applied at build time


#3

I have the same issue, “retained” has no storage class or type specifier … I have the correct target set :

{
    "settings": {
        "extensions.ignoreRecommendations": true,
        "C_Cpp.default.configurationProvider": "particle.particle-vscode-core",
        "files.associations": {
            "*.ino": "cpp"
        },
        "particle.targetDevice": "BCCU_3",
        "particle.firmwareVersion": "0.8.0-rc.10",
        "particle.targetPlatform": "electron"
    },
    "folders": [
        {
            "path": "."
        }
    ]
}

Running Alpha 6, vscode 1.30.2 user version


#5

I also Have this problem,

A blank test application:

/*
 * Project testvs
 * Description:
 * Author:
 * Date:
 */
STARTUP(System.enableFeature(FEATURE_RETAINED_MEMORY));

retained int test;
// setup() runs once, when the device is first turned on.
void setup() {
  // Put initialization like pinMode and begin functions here.

}

// loop() runs over and over again, as quickly as it can execute.
void loop() {
  // The core of your code will likely live here.

}

Compiles with no problem, just VS complains about retained and the variable it describes.

  • VSCode Version: 1.30.2
  • OS Version: Ubuntu 16.04.5 LTS
  • Extensions installed: C/C++ (0.20.1), Cortex-Debug (0.1.21), Particle Code Snippets (1.0.0-alpha.7), Particle Themes (1.0.0-alpha.7), Particle Workbench (1.0.0-alpha.7)

#6

i posted a work-around over here :point_right: [ISSUE] retained keyword not recognized in Particle Workbench

hope it helps :+1: