afri-bit / vsconan Goto Github PK
View Code? Open in Web Editor NEWConan Extension for Visual Studio Code
License: MIT License
Conan Extension for Visual Studio Code
License: MIT License
Creating own conan packages may result in dirty packages as there might be bugs etc in the development chain. They are marked as "dirty".
Goal: Visualize dirty packes in the conan explorer (maybe with a red icon)
Implementation of feature to remote a selected remote from the explorer
I have a local Conan profile folder .azuredevops\conan\default and I am configuring the VS Conan install command in .vsconan\config.json as follows:
"install": [
{
"name": "default",
"description": "Default profile",
"detail": "Installs ready for development using the project default profile",
"conanRecipe": "conanfile.py",
"installFolder": "build/Release/conan",
"profile": ".azuredevops/conan/default",
"args": [
"-pr:b windows"
]
}
]
When i run the Install command I get the error:
ERROR: Profile not found: .azuredevops/conan/default
I am running on a windows PC so, I also tried with "\" and I also tried making relative to the config.json, all with the same result.
I only can get this to work, if I provide the absolute path, which is not an option as I want other users to be able to clone the repo where they like and it still work!
I tried to find some clues in the documentation, but could not find it.
Is it possible to provide a relative path to a local profile? If not please can someone add that feature?
I am using Conan version 1.59.0 with VS Code:
Version: 1.79.0 (user setup)
Commit: b380da4ef1ee00e224a15c1d4d9793e27c2b6302
Date: 2023-06-07T14:26:35.552Z
Electron: 22.5.5
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Windows_NT x64 10.0.19045
and VSConan v0.4.0
Enable option to upload package, either the complete recipe or selected binary package
First of all, thanks a lot for writing this extension! VS Code has been lacking a good Conan extension but this one already looks very promising and it's just the first release.
I'd like to suggest a feature to create/list/delete editable packages. Managing editable packages is rather cumbersome to do on the command-line because you have to type a lot. It would be great if the extension could make that easier by
conanlayout.ini
would be a plus)Provide a dependency treeview from the conan recipe in the workspace.
The treeview in here is meant the treeview from VS Code on the activity bar.
If you work on a conan workspace, we would like to provide you a possibility to analysis the conan dependencies from your workspace, and check, whether it's already available in the local cache or not. In case it isn't there will be an option to download and save it your local cache per button click.
This feature must enable user to see the dependency graph from a selected recipe in the cache or from current conan project in the workspace
It would be great if, like the CMake extension, you could add buttons to automatically run "conan install", "conan build", and "conan create".
It would also be great to be able to select different profiles to run from a menu here (also like CMake) so that we could easily switch from debug to release, cross compiling, etc.
Nice extension btw!
Hi,
I've got an error when using pythonInterpreter
with a python venv and a custom conan user home.
Here my user settings.json:
"vsconan.general.pythonInterpreter": "C:/pyvenv_conan/Scripts/python.exe",
"vsconan.general.conanExecutionMode": "pythonInterpreter",
"vsconan.general.conanUserHome": "C:/Users/user/.conan",
My workspace settings.json is empty.
When I try to refresh I get the error The "path" argument must be of type string. Received undefined
. I've also checked using double backslashes for the paths. I assume the problem here is that the conan.exe
lies next to the python.exe
inside the venv unlike for a normal python installation.
Best regards
Whitespaces are not supported in workspace names.
vsconan/src/conans/conan/commandBuilder.ts
creates the cmd
as an array, but then does a join
, concatenating it to a string:
public override buildCommandCreate(wsPath: string, cfg: ConfigCommandCreate): string | undefined {
// Initialized the command in array of string. Later on will be converted to plain string.
let cmd: Array<string> = [];
cmd.push("create");
// One of mandatory attributes is the path to the conanfile.py
// If this is empty the whole command build process will be cancelled.
if (cfg.conanRecipe !== "" && cfg.conanRecipe !== undefined) {
cmd.push(utils.workspace.getAbsolutePathFromWorkspace(wsPath, cfg.conanRecipe));
}
else {
return undefined;
}
...
return cmd.join(" ");
}
vsconan/src/utils/utils.ts
has the whole cmd
as string
, instead of an array, what https://nodejs.org/api/child_process.html#child_processspawncommand-args-options appaerently would support.
export async function executeCommand(cmd: string, channel: vscode.OutputChannel) {
// const exec = util.promisify(require('child_process').exec);
// const { stdout, stderr } = await spawn(cmd);
channel.show();
const ls = spawn(cmd, [], { shell: true });
Each conan package from a recipe can have multiple revisions. Therefore we need an extra treeview to extend the visualisation of the package revisions.
Hi afri-bit!
First of all: I like your extension! The quality looks really good. π
In the company I'm working for, we're also using Conan (2) to manage C and C++ dependencies (most of the times using CMake).
We want to provide our developers a very smooth development experience. More precisely we want to have all extensions working within an Conan environment.
For e.g. VSCode CMake extension this works out of the box by the presets generated by Conan itself. But if other extensions (or even the Terminal) rely on some PATHs entries (or other environment variables) we don't have a sound solution at the moment.
Our workaround at the moment is: I've written a small generator that creates a .env
-File and use direnv to modify the VSCode environment.
Are you interested to add such a feature to your extension? For sure, I would implement and test the feature (And discuss the approach with you upfront). π€
What do you think?
I am using Ubuntu 20.04 and have customized my CONAN_USER_HOME
variable in my bash profile .bashrc
. Unfortunately, the extension does not load the bash profile when it invokes conan commands, thus conan uses the default user home and does not find my profiles.
I am not sure if it is feasible for the extension to automatically run conan in the context of my bash profile. If not, another solution could be to allow setting arbitrary environment variables in an extension setting.
Load and view implementation of Conan packages for selected items in Conan Remote. βvsconan.explorer.treeview.remote.item.selectedβ is not implemented. You can load all available packages from the repo using the command βconan search β*β -r=conancenterβ or other repos.
Implementation of the change package in editable. It would be good if you could change the package to editable.
'Conan editable, add "path" "package name""
Path and package name sould be inserted.
With the explorer user must have a possibility to add a new remote.
User has to have possibility to open the following folders from the recipe folder:
Options to open in VSCode to be considered.
It would be great if we could click on a binary package release and see both the local cache "settings" (what make up the hash) as well as the settings of corresponding packages on the remote.
Basically, a wrapper around "conan search -r /@" so that we can identify easily if binary packages are missing settings.
Feature to remove profile using the explorer
The extension currently fails to function if Conan has been installed using one of the alternative installers, i.e. not as a pip package. E.g. on my system, Conan is at C:\Program Files\Conan\conan\conan.exe
and is in the PATH but a command like python -m conans
does not work.
If there are technical reasons why a pip installation is required and alternative installers cannot be supported, I suggest to at least make that fact clear in the README and ideally showing a more helpful error message when the pip package cannot be found.
Additional execution mode auto
should be added to let the extension detect conan
in the environment and decide which conan
executable from the system should be used for the extension.
This will enable user to use the extension without modifying the settings.json
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.