I’ve been trying to extract JAR template using both VS Code VEXCODE and the regular VEX V5 code software. When trying to import the template just using the VEX V5 app, the file cannot be selected. When suing VS Code, it returns this error:
Does anyone have any insight into why it isn’t extracting correctly?
Importing JAR Template fails on my computer too, on VSCode and Vexcode Pro V5. My guess is that some protocol (Vex Extension? Vex Makefile? Windows?) has changed recently. I will do my best to help but am also studying for finals at the moment.
Yeah that seems like the logical conclusion. We can just make do with other solutions for the next comp. Only problem we have is that we don’t really have an IMU and we suck at building our own code to PROS isn’t very appealing atm.
Just create a new project, move the necessary source and include files to it, not really complicated.
I did try importing earlier, the only thing I had to do was make sure the folder was named the same as the project (JAR-Template), it worked ok, not sure what version of the vex extension I’m running though as I generally run unreleased beta versions.
Did you change how the Import button on VSCode functions within the last week or so?
I really liked being able to say “click the import button” in the JAR Template instructions, but I don’t see what the use of the import option is anymore.
I don’t work directly on the extension, but as far as I know there’s been no change in functionality. I do believe the unzip library we use has changed though. I’ve asked the dev to look into this.
So I got a chance to look at this yesterday evening.
There is an issue with import that only affects VEXcode Pro V5 projects.
I was able to reproduce and fix the issue in code yesterday evening, but I probably won’t have time to release a patched version until sometime next week.
As work around for now , I would just do what @jpearman suggested below:
Thanks for bringing this issue to our attention , I appreciate it!
I have started the path to learning this so I can teach my students. Struggling a little at this point. I have installed VS and the Vex VS extension, started a new project and saved it and then copied in the src and include folders into the project that was created (afore mentioned import issue work around).
I am not confident that all the headers are talking to each other or maybe the libraries aren’t loaded, but I get a lot of syntax errors because it seems the classes aren’t recogized. Please see the below picture and tell me if this is what should be expected at this point.
They are just intellisense errors because (I assume) drive.h doesn’t include vex.h, but it really doesn’t matter if the project builds. This sort of thing happens often in development when headers need to be included in a source file in a specific order.
drive.h actually does include vex.h, but I think the squiggles actually come from lack of namespace, because changing motor_group to vex::motor_group for example, removes squiggles on vscode.
I do have a question, @jpearman, design-wise, would it be wise to add using namespace vex to the top of these files, manually add vex:: to each class, or is it really not such a big deal?
It’s just intellisense being dumb.
In whatever version of VSCode and Intellisense I have installed, the squiggles don’t show for motor, motor_group etc. but do for vex::task. Depending what other files I open, it finally figures it out and they go away.
It’s generally not popular if a header file uses “using namespace xxx” as everything in that namespace gets pulled in, better to use
using vex::motor
etc.
However, it probably doesn’t matter with these V5 projects.
Already robot-config.h has “using namespace vex” which is included in vex.h, there’s a lot of circular including going on, vex.h includes drive.h which includes vex.h, obviously #pragma once should deal with that but perhaps it confuses intellisense, idk.
Sorry for any confusion, my last post was just asking for help on how to make JAR template better, not really a suggestion for what to do to fix squiggles.
On your end, I assume your ultimate goal is to set 5 or 10 teams of students up with JAR template. All they should have to do is the import issue workaround (which should be fixed soon, hopefully, but is pretty solidly out of my control), but adding using namespace ... in the drive.h file really isn’t necessary.
After they manually import, just have them follow the instructions, build the project, confirm a successful build, and download the example program to a robot.
Sorry to reopen this thread, but how exactly do I do this? I tried dragging the files out of the ZIP (I have WinRAR) and it didn’t work, then I tried importing them one by one into one code but everything was jumbled and I could tell it wasn’t the way.
Has the question already been solved, if not then:
The JAR template import issue is likely related to file permissions or path settings. For the most reliable results, try placing the JAR file directly in your project’s root directory before importing.
Additionally, make sure you’re using the latest version of both VS Code and the VEXcode extension, as older versions had some known issues with template imports.