VEX Visual Studio Code Extension

VEX is excited to announce the Preview Release of the VEX Visual Studio Code Extension.

VEXcode is the recommended coding environment for VEX users as they start their journey learning to code. Students considering a career in coding, and who have become proficient in textual coding, will benefit from learning the tools used by professional coders. Microsoft’s Visual Studio Code is the tool of choice for 70% of professional coders worldwide. VEX has created an extension for Microsoft’s Visual Studio Code (VS Code) for this purpose.

VS Code is a feature rich and extensible integrated development environment which is used by professionals everywhere to create production quality software. The VEX VS Code extension will allow users to use production quality tools seamlessly with VEX hardware. The source code to this extension will be released as an open source project, which will allow other users to build on top of what we have done to create new tools that they may find useful.

Extension Features

  • VS Code compatible (version 1.66+)
  • Windows and Mac OS compatible
  • IQ (2nd Gen), EXP, and V5 compatible
  • C++ and Python supported
  • Updates VEXos firmware
  • Intellisense for the VEX API
  • Integrated help/documentation
  • Imports projects from VEXCode
  • Creates new projects from templates
  • Hardware troubleshooting tools

Advantages when compared to VEXcode

  • Multi-file support for C++
  • Version control integration (Git…)
  • Real time code collaboration with Live Share Extension
  • Customizable interface
  • User extensible with other VS Code Extensions

The GitHub repository for this project is not yet complete. The source code will be made available before we exit the preview stage of the release. Once the GitHub repository is complete we will use that repository to track issues. For now please post feedback on the forum and we will get your issue addressed.

Here are some features we are working on in future releases:

  • Enhanced API Help and Documentation
  • Robot Config Helper
  • Feedback tool (like in VEXCode)
  • Multi-Language Interface Support.
  • Additional Example Projects
  • Vision Utility Integration

The VEX VS Code Extension is available now on the VS Code Marketplace (VEX Robotics - Visual Studio Marketplace).

Here are a few VEX Library articles to help get you started:

45 Likes

LETS GO!!!
Hphillips, Levi, Jpearman and everyone else THANK YOU SO MUCH!!!

17 Likes

Lots of credit here goes to @hphillips who did most work on this extension.

30 Likes

This is really cool!

Any reason Linux isn’t on that list too? Installing the extension and creating a project seemed to work fine for me on Ubuntu 20.04. Is it a case of “it will probably work, but we can’t provide support”?

19 Likes

pretty much, we will give more details later, but depending on Linux version additional libraries may need to be installed and udev rules added. The low level communication code is built for Linux x86, and both arm 32 and 64 bit architectures.

20 Likes

yooooo

1 Like

Hey I can’t seem to import a whole folder. I’m trying to import my school’s repo for vex into visual studio but there isn’t an option to do so.

correct, you can import individual projects but not a folder full of projects.

10 Likes

I’m so excited to hear this.

When I imported my original program in vexcode, I found that all the rotation functions in my program reported errors.Does anyone have the same problem?

It gives an error : Class ‘vex::motor’ has no member ‘rotation’.

I looked at the vex_motor.h files for vscode and vexcode and found that they are different. The rotation of double type is defined in vexcode, but in vscode, I didn’t find it.

1 Like

ok, so that didn’t take long.
The visual studio code extension contains an updated version of the V5 SDK (and also EXP and IQ generation 2 SDKs). We have removed some of the old obsolete motor APIs. Ideally we would have deprecated them, but it seems that warnings create just as many questions as errors do, so it was time to pull the band aid off and break some code. The good news is that it’s pretty easy to update to use the preferred “spin” variant of the functions that have existed in parallel with the “rotate” version since the days of VCS.

The following have been removed from motor and motorgroup classes.

 - bool rotateTo( double rotation, rotationUnits units, double velocity, velocityUnits units_v, bool waitForCompletion=true );
 - bool rotateTo( double rotation, rotationUnits units, bool waitForCompletion=true );
 - bool rotateFor( double rotation, rotationUnits units, double velocity, velocityUnits units_v, bool waitForCompletion=true );
 - bool rotateFor( directionType dir, double rotation, rotationUnits units, double velocity, velocityUnits units_v, bool waitForCompletion=true );
 - bool rotateFor( double rotation, rotationUnits units, bool waitForCompletion=true );
 - bool rotateFor( directionType dir, double rotation, rotationUnits units, bool waitForCompletion=true );
 - bool rotateFor( double time, timeUnits units, double velocity, velocityUnits units_v );
 - void rotateFor( directionType dir, double time, timeUnits units, double velocity, velocityUnits units_v );
 - void rotateFor( double time, timeUnits units );
 - void rotateFor( directionType dir, double time, timeUnits units );

 - void resetRotation( void );
 - void setRotation( double value, rotationUnits units );
 - double  rotation( rotationUnits units );

 - void startRotateTo( double rotation, rotationUnits units, double velocity, velocityUnits units_v );
 - void startSpinTo( double rotation, rotationUnits units, double velocity, velocityUnits units_v );
 - void startRotateTo( double rotation, rotationUnits units );
 - void startSpinTo( double rotation, rotationUnits units );
 - void startRotateFor( double rotation, rotationUnits units, double velocity, velocityUnits units_v );     
 - void startSpinFor( double rotation, rotationUnits units, double velocity, velocityUnits units_v );
 - void startRotateFor( directionType dir, double rotation, rotationUnits units, double velocity, velocityUnits units_v );     
 - void startSpinFor( directionType dir, double rotation, rotationUnits units, double velocity, velocityUnits units_v );     
 - void startRotateFor( double rotation, rotationUnits units );
 - void startSpinFor( double rotation, rotationUnits units );
 - void startRotateFor( directionType dir, double rotation, rotationUnits units );
 - void startSpinFor( directionType dir, double rotation, rotationUnits units );

any rotateTo or rotateFor can be replaced by equivalent spinTo or spinFor versions.
rotation is replaced by position.
startRotate… or startSpin should not be used, spinFor and spinTo should be used with the optional waitForCompletion parameter set to false.

I should add that this change to the SDK will also impact future versions of VEXcode.
It will not affect any block code or block code that has been converted to C++, it will also not impact Python as the “rotate” variant of the API has never been available in Python.

18 Likes

Ok, did you only update the vex_motor.h, are there any changes to other files?

1 Like

The above change only affects the motor and motor_group classes. There are other minor changes in the SDK but we generally do not remove functionality, this was an exception. Having two APIs with identical functionality was caused by decisions made during VCS development, but it’s been three years since VCS was replaced by VEXcode and it’s time to simplify things.

I had hinted that this was coming a few weeks back (actually way back)

11 Likes

Wow, this is awesome! Is there any chance that we may see support for other IDEs, Jetbrains ones in particular?

3 Likes

Everyone: talks about how a VSCode extension will come eventually
Literally the next day:

2 Likes

I’m pretty sure the source of the 'eventually’s was this?

how do you implement version control then? Thanks.

So will this allow us to use things such as Ez-Template or Okapi implementations?

1 Like

I may possibly release WHOOP API for VEXCode in the future, which is similar to the Ez template :slight_smile:

4 Likes

No more cat?
Rip cat 2022-2022

That would be awesome but sadly I need a solution for now, but that sounds like it would help a lot of people who use it correctly. With this being released I was wondering if this would allow for API’s like Okapi to be used and would it even be worth using in its current state compared to the normal application of vexcode.

1 Like