Cannot find Arduino IDE path. In Visual Studio Code - visual-studio-code

I wants to use Arduino in vs code Visual Studio Code.
I installed arduino IDE on my local machine on C:\Program Files\Arduino IDE I also added arduino path my Visual Studio Code's setting .json
"arduino.path": "C:\\Program Files\\Arduino IDE",
setting .json
I am using arduino extension.
This is the pic of extension
Any suggestion or recommendations would greatly aid me. I've been struggling to find a solution for this problem for 6 hours.

This was giving me issues for the longest time, too. It seems that the Arduino 2.X IDE doesn't work well with VSCode.
To resolve, use the legacy IDE (Arduino 1.8.X). First, uninstall the 2.X version of Arduino. As of February 2023, you can download the legacy version by going to the Arduino Downloads page and scrolling down to the "Legacy IDE (1.8.X)" section. There's a few different download options. I opted for the one labeled "Windows Win 7 and Newer" since it's a neatly contained executable to install Arduino.
From here, run the executable and install normally. I also reinstalled the Arduino plugin in the Visual Studio marketplace (not sure if necessary, but it doesn't hurt). There's at least three places you could potentially enter the arduino.path:
The one in YOUR PROJECT FILEPATH/.vscode/settings.json
The one in the VS Code User Settings (File>Preferences>Settings> User tab> Search for arduino.path in the search bar)
Same as above, but on the "Workspace" tab instead of "User"
For me, leaving all three empty worked fine. I believe that's because the installer added Arduino to the Windows Path variable. Here's a related post, though, where someone had to configure the path variable in case that doesn't work for you.

Related

Why do no programs run in visual studio code?

I recently got a new computer and reinstalled visual studio code but I haven't been able to run any of my files. The error has occurred with both python and C++, so I feel as though it is the IDE that is the problem. I have looked online and there are no straight answers as I have tried following some solutions which have resulted in different errors.
The error above comes up when I run (F5) a simple line of code in c++. Does anyone have a solution?
Thanks, Jacob
[EDIT]
For my python files to work I have to manually select 'Python: current file' but for c++ files they still have the same error.
First step, uninstall python from this machine.
Second, reinstall and make sure that you check the box "add to path".
It's pretty easy to miss as it's a small box, and I missed it my first time installing python earlier in the year. Here's the box you may have missed while installing.
It could be your extensions.
I had a similar error message and simply updated all of my extensions and then my SDK. I was then able to run my code within the IDE. I was using VSCode for c++ and also updated my GCC compiler along with the extensions.
Also look into your computer's environment variables, if you have changed the %PATH variables it may be affecting your ability to run/compile programs.

Missing Photon Pun assembly reference with Visual Studio Code 1.50.1

I am developing Unity game apps on a PC using C#, using Visual Studio Code as the editor. The apps are targeted at PC and Android. Multiplayer uses Photon Pun 2.
The Unity version is 2019.3.14F1 - I don't want to move forward just yet in case of 'unexpected problems'.
The VS Code version was 1.48.3 - and everything was fine, no compile errors, all code working OK etc.
Stupidly, I took Microsoft's advice to update VSC, and VS Code went to 1.50.1. Result of this is that there are all sorts of errors showing up in VS Code relating to the Photon code. All these errors stem back to the 'using Photon.Pun;' line. It says "the type or namespace name 'Pun' does not exist in the namespace 'Photon' (are you missing an assembly reference?)".
The code however does not come up with any compile errors in the Unity editor itself, and it all runs fine, including the Photon parts. The problem is in VS Code.
I realise this is almost certainly as VS Code problem, not Photon, but I am wondering if anyone has met this before and knows how to fix it?
(This is why I do not want to move from 2019.3.14F1 to 2020.whatever at the moment - you never know what might happen).
I had the same problem. Installing different versions of VS Code / VS Community Edition didn't fix anything for me, but this did:
With the project open in VS Code, find all occurrences of
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
in *.csproj files, and replace them with
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
Tried rebuilding project files, swapping to a different editor (VS Community Edition 2019 - that was fine), but no difference - VSC persisted with the errors. Rest of intellisense working OK.
In the end, totally uninstalled VSC and reinstalled, and that sorted it out. No idea what the actual fault was.
I was wrong.
To-day, the errors are back.
The reason appears to be that in the process of trying to sort this, I installed VS Community Edition 2019 to see if that worked OK (it did). Then went back to VSC, and - that was fine too. Later I uninstalled VS Community Edition 2019 (it is taking about 4GB). It was uninstalling that which brought the errors back into VSC. Reinstalled VS Community Edition 2019, and it is all fine again.
So, VS Community Edition 2019 installs something that VSC needs - but I haven't yet figured out what it is.
UPDATE:
Gave up. Never managed to find out what VSC wanted and wasn't getting. Instead, reinstalled old version of VSC (1.48.2 from code.visualstudio.com/updates) and it is all fine again.
If still having this problem, all you have to do to fix it is by going to Package manager and install "visual studio editor package"
windows>Package Manager> All Packages /or Unity Registry (depeding on your unity version) search of visual studio editor
if it's already installed delete it and reinstall.
Got it FIXED!
Solution (it was a Unity issue):
In Unity, goto Edit > Preferences > External Tools > External Script Editor, and point it to Visual Studio..
Why this was so hard to find, I have no idea. But now my Photon solutions and namespaces properly transfer from Unity to Visual Studio. Hooah!
Also moved the script to where the photon scripts are
Uninstall the Visual studio community and re-install with latest VSC 2022. It will fix the issue

Can I have multiple configurations of Visual Studio Code, one per coding language, each with its own plugins?

This is not a duplicate of How do I open multiple instances of Visual Studio Code?.
My previous question, How can I make Visual Studio Code's auto-complete suggestions appear more quickly? explains my problem.
I was using VSC with the PlatformIo plugin for embedded development for a few months with no problem. Then I started on Flutter/Dart and soon had a problem with auto-suggest being really slow.
It could be that I just loaded a duff plug-in (I am adding them back, one by one, to see if/when it "breaks"), but ... I am considering doing all development in VCS, so as to have a single IDE.
I am currently using Eclipse for C/C++ and PHP, WebStorm for AngualrJs and PyCharm for Python.
I had previously used Eclipse for everything, and had a different copy of Eclipse for each language, each with its own plugins.
Since I will be developing in 4 or 5 languages, even if I don't hit a problem as bad as I just did, adding plug-ins for that many languages into a single IDE will inevitably slow things down.
So, question: can I have multiple installs of VSC, each with its own plug-ins, and launch them separately?
I solved this problem on windows using vs code portable.
I created a folder at the root of my machine with subfolders for each language, inside each I put the vs code, then I created a data folder inside each of them so that the information was stored locally, I modified the name of the executables and added it to the path.
As an example, to access a vscode configured for python I put code-python . at the terminal.
I Have the idea watching this video, it may help you (it is in portuguese, but you can see more os less what it does).

Building QGIS source code on Windows 7 - Not working

As mentioned here I've tried to build the QGIS on Windows 7.
There are two methods one using Visual Studio Express Edition installer and the second one using MinGW.
I've found both of them broken and don't know what to do next
In building using Visual Studio
The link to visual studio actually installs the version 2010 but documentation assumes it version 2009. So "set VS90COMNTOOLS=%PROGRAMFILES%\Microsoft Visual Studio 9.0\Common7\Tools\" path is not found.
Also I'm confused about the context of this line:
If the path to bison and flex contains blanks, you need to use the
short name for the directory (i.e. C:\Program Files should be
rewritten to C:\Progra~n, where n is the number as shown in `dir /x
C:``).
In Building using MinGW 4.2.1. MSYS link is not found(404) but when I try to build step by step I find XDR 4.0 not found(404) in this page
So what's the way to build it?
All I want is to change the title and startup photo of QGIS Desktop software.
Using another application I'm now able to change the title of running QGIS but don't know where to change the photo which shows "Loading plugins...".
The build instructions for Windows 7 are a tad long in the tooth, but they work for the most part. I did not try MinGW.
I immediately changed the VS90COMNTOOLS path to point to the Visual Studio 2010 directory and it seemed to work for me:
set VS90COMNTOOLS=%PROGRAMFILES%\Microsoft Visual Studio 10.0\Common7\Tools\
Regarding bison and flex configuration, I used the latest version of CMake (3.3.1 as of now) and didn't encounter any warnings/errors pertaining to bison or flex. Are you encountering any right now? If not, you should be able to proceed.

Visual Studio Code on Mac

I installed Visual Studio Code on Mac/OSX (drop app in Applications)
- uninstalled (moved the App to the Trash)
- installed again
Since the second time I installed I didn't get the same start screen as during my first install I suppose somewhere in my file system Visual Studio Code writes something?
I would like to know where (besides in the Application folder) Visual Studio Code writes files?
VSCode uses another folder to store settings, including a flag to indicate if welcome should show or not. The folder is:
Windows: %APPDATA%\Code
Mac: $HOME/Library/Application Support/Code
Linux: $HOME/.config/Code
I've looked on my wife's mac and can't find a trace of these settings, they're not in any standard folder ($HOME, /Libraries/Preferences, /System/Libraries/Preferences nor /Libraries/Containers).
But to open the original start screen, you can use Help -> Show Welcome.
The settings are stored though, if you run "defaults read" you will see a number of settings related to vscode mentioned, including the files you had open last time you closed. Since Visual Studio Code uses the GitHub Atom Shell under the hood, you need to read the settings for atom using
defaults find atom
which will show you some data stored for the app.