X
6310 Rate this article:
4.5

Back to the Future: IDL® for Visual Studio Code

Zachary Norman

TLDR: We have an official extension for Visual Studio Code called IDL for VSCode! It is open source on GitHub, you can see some of the features we have planned, and there’s a place to ask questions and provide feedback. See below for a story about our journey to get here, our inspiration for the user experience, and our goals for community engagement.


 

Hey everyone!

My name is Zach Norman and, if you keep up with our “What’s New” webinars, you probably know me as one of our product managers. As part of my role, I work with most of our commercial products, including IDL.

I am really excited to talk about Visual Studio Code and our new official extension: IDL for VSCode. This has been in the works for quite a while and was officially (albeit quietly) released in July.

Here’s a quick screenshot showing what it looks like:

 

Screenshot shows the syntax which highlights a session of IDL running from within VSCode. The new IDL extension also includes syntax highlighting and hover help for task files (shown on the left).

Although I’m a product manager, I’m also an avid programmer. When I’m not spending my days writing IDL code or playing with the ENVI® API, I’m typically doing some style of full-stack development with TypeScript, Node.js, and Angular.

One of the things I have always loved about these extremely popular languages is the fantastic tooling and integration with VSCode. For me, it really makes programming with these languages enjoyable and was a great source of inspiration for our new IDL user experience.

Based on this, these were some of the goals I had in mind when we started out on this path:

 
  • Help improve productivity of IDL programmers by changing the way that they write and interact with IDL code

  • Provide a modern alternative to the IDL Workbench

  • Lower the barrier to entry and create a new playground to get started with IDL

  • Engage the community in a new and different way than we have in the past

  • Don't require IDL to be installed, or up-and-running, to write IDL code

 

To start making these goals a reality, I tried to draw from what I liked about language support for TypeScript, the prettier toolset for formatting code, and ESLint for providing feedback on the code that I write.

This brought us to a basic set of requirements for how we wanted everything to work:

 
  • Perform static analysis of your code to understand potential problems before ever compiling or running IDL code

  • When problems are detected, add a little detail for why it is an issue and what can be done to fix it

  • Provide a no-frills formatter that is easy-to-use and include a new standard for the visual appearance of IDL code

  • Integrate with VSCode so that when a file is saved, select problems can be formatted and fixed automatically

  • Highlight code based on the syntax for (almost) flawless syntax highlighting

 

Now, I’m not going to go into the details of everything here, but will touch on a few of the items above. First, let’s see an example of problem detection:

Here we have a “bad” block of IDL code that shows 5, of the more than 100 problems, that we can automatically detect. Some of these issues, such as the missing “compile_opt idl2” are great ways to enforce the modern paradigm of IDL programming and avoid common pitfalls. Some of the others problems that are detected are a little nuanced and, if you’re an expert and don’t like them being reported, you can update your preferences to turn them off.

The other way we try to make users more productive is through a rich and integrated hover help and auto-complete system. This has many features, but is focused on a few key capabilities: attempt to automatically detect data types, use data types to provide correct auto-complete, and use data types to provide hover help driven directly from the documentation.

Here’s an example:

The auto-complete and hover help come directly from the documentation or your own code. If you follow the IDL Doc standard for documenting routines and their parameters you can create this content yourself. If you don’t know what the IDL Doc standard is, there’s automated tools in the extension to generate or update existing documentation to help you save time.

Through hover help, you can also find the feature that we are most excited about: IDL Notebooks! Today, the extension includes a preview of IDL Notebooks so that we can get feedback from users as we continue development.

The easiest way to access and try IDL Notebooks is through hover help. When you hover over a routine, click on the “Open Examples in Notebook” button which, as it says, opens up any examples from the documentation in an IDL Notebook. This makes it trivial to copy/paste code from the docs or run a snippet and see what it does.

The notebook feature will be officially released later this year with the next version of ENVI and IDL. Until then, feel free to try it out! We really see this becoming the new way for users to write and interact with IDL and the ENVI API. There’s going to be some goodies in the future to embed maps and other visualizations when working with image data using the ENVI API, but you’ll have to join us for the official release webinar to learn more.

The last item I wanted to talk about is community engagement. It has been a goal of mine, as a product manager, to change the way that we interact with the community and our user base. With our recent acquisition by NV5, this became a real possibility.

To start, we made the IDL extension open source and publicly available on our GitHub organization here. You can find the source code, report problems, or make changes and contribute to the extension if you want. But this wasn’t where I wanted to stop.

We also have a GitHub Project that captures some of the features that we would like to implement as part of the extension. With this being publicly available, our goal is to be transparent and allow any user the opportunity to request features or add in their opinion about what we spend time developing. While you could send an email to tech support and provide feedback that way, I find it much easier to just work direct on GitHub which can hopefully make a new platform for collaboration as well.

We look forward to more users trying out the IDL extension for VSCode and giving the community the opportunity to directly engage regarding the extension.

If you have comments or questions, reach out using a GitHub Discussion or you can send me an email directly at Zachary.Norman@NV5.com.

Have fun programming!


 

DISCOVER MORE

 DEMO VIDEO
Watch a quick demo to learn about IDL Notebooks, available in IDL for VSCode

 TUTORIAL VIDEO
Watch the full, in-depth tutorial about IDL Notebooks

Reimagine Coding with IDL for VSCode

LIVE WEBINAR - APRIL 11

Modernize the way you program with IDL with VSCode.

Students, Researchers and Instructors

ACADEMIC SOLUTIONS

Using ENVI and IDL for research and to prepare students for successful careers.

ANSWERS YOU CAN TRUST

ENVI SOFTWARE

Process and analyze all types of imagery and data.