nix-env-selector icon indicating copy to clipboard operation
nix-env-selector copied to clipboard

Have the extension output logs in the Output window

Open nanoni17728 opened this issue 3 years ago • 3 comments

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!

nanoni17728 avatar Jun 18 '21 15:06 nanoni17728

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 👍

arrterian avatar Jun 23 '21 07:06 arrterian

I should have some free time in July!

nanoni17728 avatar Jun 29 '21 14:06 nanoni17728

Would love to see that as well!

GuillaumeDesforges avatar Sep 23 '21 12:09 GuillaumeDesforges

Done in #84 by @nh2

arrterian avatar Feb 01 '24 17:02 arrterian