Can this plugin run code in docker container and get the result in quickfix list? · Issue #273 · skywind3000/asyncrun.vim · GitHub
Skip to content

Can this plugin run code in docker container and get the result in quickfix list? #273

Open

Description

@meicale

It is a cool plugin and I like it. I use docker container as the development environment as well, which is easy to share and manage. How can I run the code in this docker container and can consume put the result in the quick-fix list as well. Maybe, I can be done by substitute the command to command with prefix “docker exec [args]". Where can I change the command actually run by this plugin? The other thing is how to get the result generated in docker container can copy it back to the host and set it in quick-fix list.
Thank you in advance!

Activity

  1. skywind3000 commented on Mar 2, 2023

    @skywind3000
    Owner

    What you need is the command modifier: https://github.com/skywind3000/asyncrun.vim#command-modifier

    you can define a new modifier in a standalone script in ~/.vim/autoload/asyncrun/program or any sub-directory named autoload/asyncrun/program inside a runtime-path.

    here is an example: https://github.com/skywind3000/asyncrun.vim/blob/master/autoload/asyncrun/program/shebang.vim

    this script allows you use:

    :AsyncRun -program=shebang  ls -la
    

    the command ls -la will be processed and replaced by shebang.vim before execution.

  2. meicale commented on Mar 4, 2023

    @meicale
    Author

    I don't think it is that straightforward. I use a compiler to deal with my python traceback and I have to use the same file directory between host and container. Can this be solved to provide something like path_mapping in neovim dap debugger remote? We can sed the result and replace with the right file path of the trace back result. I think it is quite common and helpful if we can support running code in docker easily. Path mapping and helper function can be one of the solutions to this. I know little about the vim script and can this done using lua? How should we put the result in the quickfix list using neovim api or lua function?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions