Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pipes not working #332

Open
noonien opened this issue Mar 11, 2024 · 2 comments
Open

Pipes not working #332

noonien opened this issue Mar 11, 2024 · 2 comments

Comments

@noonien
Copy link

noonien commented Mar 11, 2024

This might be related to #321 however, I'm not using dev containers.

I'm getting the following errors when trying to use pipes:

!#uname:

error executing command "dance.selections.pipe.append": Invalid host defined options

|#wc -l:

error executing command "dance.selections.pipe.replace": Invalid host defined options

All other extensions are disabled and I'm not using devcontainers. I am, however, using NixOS which is quite different from other distros.

I have no idea how to debug further, let me know if there is any more information I can provide.

I am using the latest pre-release version, v0.5.14002.

@noonien
Copy link
Author

noonien commented Mar 11, 2024

I've cloned the repo, opened it in VSCode, and used "Launch extension" to run the extension in a fresh editor, pipes work just fine in the "Extension Development Host".

@d7sd6u
Copy link

d7sd6u commented Sep 12, 2024

@noonien
It is not a pretty solution, but it works. Something is wrong with dynamic imports - so by changing import("child_process") to Promise.resolve(require("child_process")) the issue is fixed on NixOS. I haven't yet properly packaged it, but it should be as simple as:

let
  dance = inputs.nix-vscode-extensions.extensions.x86_64-linux.vscode-marketplace.gregoire.dance;
in
(pkgs.runCommand
  "patched-dance"
  {
    vscodeExtUniqueId = dance.vscodeExtUniqueId;
    vscodeExtPublisher = dance.vscodeExtPublisher;
    version = dance.version;
  }
  ''
    input=${dance}/share/vscode/extensions/gregoire.dance
    output=$out/share/vscode/extensions/gregoire.dance
    mkdir -p $output
    cp -r $input/* $output
    chmod u+rwx -R $output
    mv $output/out/extension.js $output/out/extension_old.js
    cat $output/out/extension_old.js | ${pkgs.ripgrep}/bin/rg 'import\("child_process"\)' --passthru --replace 'Promise.resolve(require("child_process"))' > $output/out/extension.js
  '')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants