arrterian / nix-env-selector

Allows switch environment for Visual Studio Code using Nix Package Manager.
MIT License
220 stars 29 forks source link

Have the extension output logs in the Output window #59

Closed nanoni17728 closed 7 months ago

nanoni17728 commented 3 years ago

Hi!

I had a problem with my nix environment file, but I couldn’t find any error log in VS Code itself. AFAIK your extension doesn’t log anything anywhere at the moment. There exists an output window that extensions can use to send their log to. This would be useful to get feedback if something went wrong.

How to reproduce the behavior: Open a folder on VS Code with a env.nix file containing:

{ pkgs ? import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/refs/tags/21.05.tar.gz") {} }:

pkgs.mkShell {
    buildInputs = [
        pkgs.npm
    ];
}

Open the command palette and use Nix-Env: select environment to select env.nix. The extension will hang on forever while trying to apply the environment.

Using nix-shell env.nix in a terminal instead logs this error: error: attribute 'npm' missing, at folder/env.nix:5:9 and terminate its process.

I’m kinda busy at the moment, but I can make a pull request if I find some free time if you would like. Thanks for your time!

arrterian commented 3 years ago

I consider your issue completely valid. The topic has arisen in other discussions. If you will able to add logging it'll be awesome :) Thank you for your contribution 👍

nanoni17728 commented 3 years ago

I should have some free time in July!

GuillaumeDesforges commented 2 years ago

Would love to see that as well!

arrterian commented 7 months ago

Done in #84 by @nh2