Skip to content
This repository has been archived by the owner on Oct 1, 2024. It is now read-only.

Arduino: Examples command displays an empty tab #533

Closed
Kurolox opened this issue Apr 17, 2018 · 10 comments
Closed

Arduino: Examples command displays an empty tab #533

Kurolox opened this issue Apr 17, 2018 · 10 comments
Assignees
Labels
code ready needs-more-info More details about this issue are needed for it to be actionable.
Milestone

Comments

@Kurolox
Copy link

Kurolox commented Apr 17, 2018

Basically, whenever I try to use the Arduino: Examples command it displays an empty tab like this.

The arduino path in the settings is set up as "arduino.path": "/usr/share/arduino", and the examples are in /usr/share/arduino/examples. the Arduino IDE lists the examples correctly.

VSCode version and information:

Version 1.22.2
Commit 3aeede733d9a3098f7b4bdc1f66b63b0f48c1ef9
Date 2018-04-16T09:43:25.785Z
Shell 1.7.12
Renderer 58.0.3029.110
Node 7.9.0
Architecture x64

Arduino plugin version: 0.2.12

@Sneezry
Copy link
Member

Sneezry commented Apr 18, 2018

What is your operating system? Is it Ubuntu?

@Sneezry Sneezry self-assigned this Apr 18, 2018
@Sneezry Sneezry added the needs-more-info More details about this issue are needed for it to be actionable. label Apr 18, 2018
@Kurolox
Copy link
Author

Kurolox commented Apr 18, 2018

Arch Linux. Here's the output of uname -a.

Linux Horus 4.15.15-1-ARCH #1 SMP PREEMPT Sat Mar 31 23:59:25 UTC 2018 x86_64 GNU/Linux

@jhenninger
Copy link

jhenninger commented Apr 30, 2018

The examples work when pointing arduino.path to an Arduino IDE downloaded from the official website.

When the Arduino IDE installed by Arch's package manager is used (/usr/share/arduino), the extensions tries to access /usr/share/arduino/libraries and throws an exception because that directory does not exist.

If you create an empty libraries directory in /usr/share/arduino, vscode correctly shows the built-in examples.

@Kurolox
Copy link
Author

Kurolox commented May 3, 2018

That workaround didn't work for me. I've created the folder by running sudo mkdir /usr/share/arduino/libraries, and rebooted the computer afterwards just to be sure, but the examples tab is still empty.

Here's the output of ls -l /usr/share/arduino, just so you can see that the folder is actually there.

total 128
-rwxr-xr-x  1 root root   946 Oct  2  2017 arduino
lrwxrwxrwx  1 root root    24 Oct  2  2017 arduino-builder -> /usr/bin/arduino-builder
drwxr-xr-x 13 root root  4096 Jan 22 16:09 examples
drwxr-xr-x  2 root root  4096 Jan 22 16:09 hardware
-rwxr-xr-x  1 root root  9713 Oct  2  2017 install.sh
drwxr-xr-x  3 root root  4096 Jan 22 16:09 lib
drwxr-xr-x  2 root root  4096 May  3 07:55 libraries
lrwxrwxrwx  1 root root    22 Oct  2  2017 reference -> /usr/share/doc/arduino
-rw-r--r--  1 root root 83921 Oct  2  2017 revisions.txt
drwxr-xr-x  4 root root  4096 Jan 22 16:09 tools
drwxr-xr-x  2 root root  4096 Oct  2  2017 tools-builder
-rwxr-xr-x  1 root root    86 Oct  2  2017 uninstall.sh

@jhenninger
Copy link

jhenninger commented May 3, 2018

Hmm, your folder looks exactly like mine.

Can you take a loot at the developer console (Help -> Toggle Developer Tools) to see what error you are getting when opening the Arduino examples tab?

Here is what I get when the libraries directory does NOT exist: https://i.imgur.com/WE7oYnn.png

@Kurolox
Copy link
Author

Kurolox commented May 4, 2018

Well, this is bizarre. It seems like it's looking for ~/Arduino/libraries for some reason: https://i.imgur.com/lGKHX8W.png

I have explicitly configured vscode to use the /usr/share/arduino path with "arduino.path": "/usr/share/arduino", but for some reason it's looking in there. I don't even have an Arduino folder in home.

Any idea about what could be happening?

I can confirm that creating ~/Arduino/libraries fixes the problem, but I wonder why it's even looking for that folder in the first place.

@jhenninger
Copy link

Afaik the offical Arduino IDE creates that folder.

@Kurolox
Copy link
Author

Kurolox commented May 6, 2018

That still doesn't explain why it's looking for the folder in that path when I've explicitly set it up otherwise on the vscode settings, though. It's still looking at the default path for some reason. Could you share your vscode config (at least the config regarding this plugin) to check if there's any difference?

@jhenninger
Copy link

I haven't changed any settings of the plugin aside from the path. I guess the extension just looks in multiple locations for libraries, examples etc. but doesn't handle missing directories gracefully.

@ArthurMa1978 ArthurMa1978 added this to the Sprint 136 milestone May 22, 2018
@Sneezry Sneezry assigned czgtest and unassigned Sneezry May 23, 2018
@czgtest
Copy link
Contributor

czgtest commented Jun 6, 2018

this issue is fix on 0.2.16, please update the latest version and use it. Thanks a lot for your feedback

@czgtest czgtest closed this as completed Jun 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
code ready needs-more-info More details about this issue are needed for it to be actionable.
Projects
None yet
Development

No branches or pull requests

5 participants