Open znorman-harris opened 4 years ago
@astrowq Here is a beta of debugging if you want to try it out! It is in a pretty good state and I have done some basic testing on Windows, Mac, and Linux. You might find some oddities, but feel free to give it a whirl and let me know if you have any issues.
It should auto-detect the location of IDL and will alert you to configure it if it can't find it. There is a command to set this preference, which can be accessed through the preferences UI.
If you download the .vsix
file from the link below, you can install it through the extensions tab by clicking on the ellipsis (the three dots) and picking Install from VSIX...
. Make sure to uninstall the previous version first.
https://github.com/chris-torrence/vscode-idl/releases/tag/v2.0.0-rc6
Edit: Update the link to the latest beta.
Happy new year! Thanks for the efforts that you put into the requested feature and other nice features. I have tried the new version and am glad to see the debug is working now. Following are some feedbacks:
Novus IDL
theme especially the bold keywords, but I do enjoy my current Solarized dark
theme. I had a look of the source code but got no clue how to customize the colours for idl code without replacing the current colour theme. Any suggestions on this?By the way, I barely use the GUI workbench and kept using emacs before switching to vscode. My workflow heavily depends on the remote ssh extension to connect to the server. So maybe some issues I got have something to do the remote and local environments. (5) is the issue I wish to solve as soon as possible. Thanks a lot!
Thanks for trying it out! Apologies for the annoying message, I missed including a file into the package which I just fixed and made a new pre-release which also has support for the profiler. You can find the updated file here, which should hopefully work better for you.
https://github.com/chris-torrence/vscode-idl/releases/tag/v2.0.0-rc3
Here are some notes about your comments (same numbering):
Is the working directory where the files live the same as the vscode workspace folder? I could see adding a preference for changing the working directory to the workspace folder directory and having the option, if you have a PRO file open, to start in the same folder.
Should be fixed with the latest release. Let me know if it isn't
This should hopefully work better now. I was seeing this before and I caught a few cases that were missed.
Breakpoints are kind of goofy - especially if they are added to a main level program. If they are added to main level, you need to recompile the file that they are in. Have to do a bit of digging to see what the workbench does to get around this.
That is an interesting comment about the terminal vs the debug console which is the VSCode standard. Is that why it helps you more to have the commands spit out into the terminal instead of the debug console? I could certainly add a configuration option which will use the terminal instead of the debug console considering. The only catch here, and the main reason I stepped away from the terminal, is that debugging wont be supported because vscode does not have an official feature to capture the output from terminals. I posed a couple of questions and, the feature I need is in vscode insiders, but there is no plan for it to become a stable feature and in vscode.
This is pretty easy to do! In the theme file that is included with IDL you will take this code and add it to the tokenColors
of the theme you are trying to edit. I'm not sure where the default vscode themes are at, but I'm sure some quick googling will find them.
Thanks for the reply!
I did this even before using vscode. Because I rarely use the workbench. There is no auto-completion in IDL's console. So if not doing this, there would be a huge pain to input file's relative path to my current work directory.
The current released version helps me a lot in terms of eliminating the need to input, such as ".r file_name.pro" every time. With the key binding, I don't even need to touch the mouse. So it's a huge time saver.
The bottom line is I would love to see options of changing the behaviour of where the working directory is located, when starting the debug session or terminal session.
2&3. Unfortunately, the problems still exist. Error messages seem to display only in the main program level, not inside the procedure. 2&3 seem to be related somehow.
This pre-released version, apart from not being fully functional in debugging, has a disadvantage compared with python extension, which is the start-up time is way too longer than python. I am using idl8.7.2. Older version like idl8.0 indeed starts up quickly, but there are only newer versions on our server (>8.5). They are slow to get started (a few secs). So if I want to just run a pro file, I would prefer to run it in the terminal where there's already a session open, instead of waiting for the debug session opening up. The current version has done this job nicely. I would like to see this way of running code could be kept.
In summary, for quickly running the code, the current version is pretty good. Maybe resolving (1) could make even better i.e. open an IDL terminal session whose working directory is the opened file's.
For debugging, a separate set of commands and doing all the stuff in the debug console seem to be the only solution at the moment.
For me, I don't spend 90% of my time in debugging but mostly analysing data and making plots, at which IDL is good. So I like the current stable version.
Thanks for giving more feedback! I appreciate you taking the time to respond and give input into the extension development.
I went ahead and added back in the terminal functionality that was there. I did some basic testing on Windows and Mac so it should be good on Linux as well. There are two sets of commands now: one for debugging and one for the terminal so that your use case will be covered. I'll work on the preference/ability to set the working directory next (workaround below)! You can grab the latest version here:
https://github.com/chris-torrence/vscode-idl/releases/tag/v2.0.0-rc5
It might be worthwhile to do a clean install of the extension and remove/verify all of your older idl extensions are gone which could be part of the problem. For this, you'll need to go into the extensions folder. Any of the folders that start with ct6502
can be deleted and you'll want to restart VSCode after. The extension folder can be found here on your machine:
https://code.visualstudio.com/docs/editor/extension-gallery#_where-are-extensions-installed
A couple of notes and comments:
From the terminal, you can start your own session of IDL before sending commands to it, so you can cd
into your working directory and continue with the same workflow that you have today.
I got logging sorted out in the extension so, if you open the preferences for IDL and enable the Debug
option, then a bunch of detail will get printed out the the extension log. Then, if there are issues, it should provide all the information needed to help me debug any issues if you can reproduce them. The log name is "IDL: Extension Host" and you can access the content from the OUTPUT
tab by the terminal.
For the "debugging" in the IDL extension, here are some notes:
If you have a folder open as your workspace, then the extension will automatically add all of your folders in the workspace(s) to the path . This means you shouldn't have to worry about your file names (unless they are al main level programs) as IDL's path will be updated.
The debug console should theoretically work just like the terminal window, apart from a few bugs with breakpoints not working correctly. Meaning you shouldn't need to start a new debug session and you can continue to use the existing session just like in the workbench which should save you some time on restarting.
Looks like this feature was implemented, released and then removed. Any plans to make this available again?
Any plans to add debugging back?
FYI if you didn't notice, we have a new version of the extension that has basic support for running IDL within VSCode:
https://marketplace.visualstudio.com/items?itemName=IDL.idl-for-vscode
Placeholder to add debugging into the extension.