Closed Joebeazelman closed 1 year ago
Hello @Joebeazelman ,
We plan to integrate Alire to our VS Code extension during the next months. Basically we want it to be trasnparent for users: if we detect an Alire project in the workspace, we set everything that is needed (environment etc.) to make it work out of the box.
We'll let you know once it's implemented.
Thanks. I already have it working with Alire.
Yes (and congrats for this!) but we want it to be more "plug-and-play" let's say ;)
In the meantime, it would be nice if there were workarounds. I figured out how to build in VSCode using Alire, but the issue with setting the environment variables is still a pain. The Ada extension requires a number of environment variables that are not set unless the user launches the project using "alr edit." If I at least know what variables the extension is looking for, I could at least implement a fix.
Just out of curiosity, based on this comment:
// Optionally, you can append the Ada toolchain of your choice to the PATH environment variable
// if you want to use a different toolchain.
// "PATH": "<PATH_TO_TOOLCHAIN>:${env:PATH}",
If I have a source-built GCC toolchain at /usr/local/gcc-dev
that isn't on my path, would adding it in this way make it override and take precedence?
If I at least know what variables the extension is looking for
alr printenv
is your friend
I've been working with the version of ALS for Visual Studio and it's a great improvement! Keep up the good work! While it no longer requires executing "alr edit" before launching Visual Studio, it still doesn't build the project using Alire. The documentation says you should execute Alire from a shell, so I added the following configuration to my tasks:
{
"version": "2.0.0",
"tasks": [
{
"label": "Alire Build",
"type": "shell",
"command": "alr build -- -cargs -gnatef",
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": {
"base": "$ada"
}
}
]
}
Now, Alire finally works seamlessly with VSCode and ALS. Hopefully, ALS will no longer require this convoluted configuration and execute Alire directly without any issues.
Should be fixed in 23.0.15
Environment
OS and Version: MacOS 12.6 (21G115) VS Code Version: 1.72.2 (Universal)
Issue
The Ada extension can't build the project because it's unaware of Alire's environment variables. To get around this issue, I overrode the extension's default task to call Alire instead (see Configuration below).
So far, the project builds, but unlike extensions default build task, whenever there's a build error, clicking on any of the errors results in VSCode claiming it can't find the file with an option to create it. I also overrode the extension's ProblemMatcher inside my build task to use a relative location as displayed in the error message, but it still cannot find them. Oddly enough, option clicking from in the terminal window works flawlessly. What could be the problem? This is a major issue for developers working with Alire and VS Code.
Configuration
Here's my workspace file (located inside .vscode folder in root of project):
Originally posted by @Joebeazelman in https://github.com/microsoft/vscode-cpptools/issues/10021