Syntax Not Recognized by VSCode


#1

I have a workspace in VS code that was not started by making it a particle project since I already had all the respective files. However, now VSCode does not recognize any syntax of my files. When I use Particle: Import Project, it does not keep my current workspace open. Is there a way to make these into a Particle project without creating a new one? These files are already part of my git repo so I don’t want to move the files to a new directory if possible! Thanks!


#2

One reason for this is probably that this file is not recognised as a Particle project.
This may also be due to the extensions not beeing fully loaded at the time.
This is also backt by the lack of these symbols at the top right of your window
image

Try creating a full project via the Create New Project command and then past your code into that.

Also when posting a screenshot of Workbench it’s also good to also show the status bar which does provide valuable information about the state of your project.


#3

Was not even aware of the status bar until now, thanks!

Creating a new project works! Is there any way to make these existing files into a Particle project without doing that?


#4

Not that I’m aware of, but you can always add existing files - you don’t need to copy/paste the sources.


#5

So I created a new project and pasted my code into the new .ino file and it was working alright with the exception of not recognizing Mesh. However, I kept going and have run into the same problem again. I was prompted to download the toolchain (although I thought I already did that?) and downloaded it. The code compiles and flashes with no problem but syntax is still not recognized.


#6

you may need to reset the intellisence database … IIRC its one of the commands - but not my PC to check…


#7

Will look into that now, thanks!


#8

An update!: So the problem comes up after successfuly configuring a project for the xenon i am working with even in a new project. After this I am notified that a compiler toolchain is available, although I already downloaded it in other projects. Resetting the IntelliSense database does nothing D:


#9

if you haven’t already seen them, we have a bunch of docs and walk-thru videos:

https://docs.particle.io/workbench/

in particular, you might want to check out:

Getting Started with Particle Workbench:

Building Firmware Locally with Particle Workbench:

regarding intellisense weirdness, unfortunately it can be a bit fiddly from time to time - we have a troubleshooting guide over here:

hope it helps :+1: