Code Monkey home page Code Monkey logo

vsconan's Introduction

πŸ‘‹ π™·πšŽπš•πš•πš˜! 𝙸'πš–β€€Afrizal

vsconan's People

Contributors

afri-bit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

vsconan's Issues

Local profile not found using relative path

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

Managing editable packages

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

  • showing a list of all packages that are currently in editable mode
  • offering an option to make the package in the workspace editable (supporting conanlayout.ini would be a plus)
  • offering an option to remove any package from the editable list

Conan recipe dependencies analysis of a conan workspace

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.

Show dependency graph from a recipe

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

Add conan commands to status bar

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!

[Error] The "path" argument must be of type string. Received undefined

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 not supported in workspace names

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 });

Feature idea: Modify VSCode environment to match `conanbuild.sh`/`conanrun.sh`

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?

Support environment variables set in .bashrc

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.

show conan remote packages, set package editable

  1. 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.

  2. 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.

View package settings per release

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.

Support non-pip conan installation

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.

Automatic detection of pre installed 'conan' in the environment

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.