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

bug: on_result_diagnostics_quickfix does not populate quickfix list #392

Open
EnDeRGeaT opened this issue Dec 29, 2024 · 5 comments
Open
Labels
bug Something isn't working question Further information is requested

Comments

@EnDeRGeaT
Copy link

Neovim version (nvim -v)

0.10.3

Operating system/version

Arch Linux

Describe the bug

I have added on_result_diagnostics_quickfix in my default components. However when I do :OverseerRunCmd g++ a.cpp with a file that has errors, my quickfix list is not populated. Yet, when I open output in quickfix list from toggle menu (or i have on_output_quickfix component), it matches everything.

What is the severity of this bug?

breaking (some functionality is broken)

Steps To Reproduce

  1. I setup overseer using lazy.nvim with the following code:
return {
  'stevearc/overseer.nvim',
  opts = {},
  config = function ()
      require('overseer').setup({
          component_aliases = {
              default = {
                  { "display_duration", detail_level = 2 },
                  "on_output_summarize",
                  "on_exit_set_status",
                  "on_complete_notify",
                  "on_result_diagnostics",
                  { "on_result_diagnostics_quickfix", open = true},
              },
          },
      })
  end
}
  1. Create a.cpp:
int main() {
    reutrn 0; // a.cpp:2:5: error: ‘reutrn’ was not declared in this scope
}
  1. Do :OverseerRunCmd g++ a.cpp

Expected Behavior

quickfix list gets populated

Minimal example file

No response

Minimal init.lua

No response

Additional context

Now thinking about it while writing this issue, is this intended behavior? That's a bit of a shame, I wanted to make a simple task which builds and runs a user provided shell command, and if I get errors (compilation errors), I can go to them via quickfix list.

@EnDeRGeaT EnDeRGeaT added the bug Something isn't working label Dec 29, 2024
@stevearc
Copy link
Owner

stevearc commented Jan 3, 2025

on_result_diagnostics_quickfix is for when you have another component that will parse the output into some result diagnostics (e.g. on_output_parse). I believe you're just looking for on_output_quickfix. Is there a reason that component doesn't work for you?

@stevearc stevearc added the question Further information is requested label Jan 3, 2025
@EnDeRGeaT
Copy link
Author

on_output_quickfix doesn't work for me because I have a on_open_output component too. I wanted to make it so that if I have errors, my quickfix list opens, otherwise a terminal opens. Currently, I have just made a keymap, which loads output in quickfix list. It's a bit manual but gets the job done. I assume that it is kinda difficult to make on_output_quickfix and on_open_output work together well, so you can probably close this issue

@github-actions github-actions bot removed the question Further information is requested label Jan 5, 2025
@stevearc
Copy link
Owner

stevearc commented Jan 5, 2025

I think we can get you most of the way there. Try modifying your on_output_quickfix component to set open_on_exit = "failure". You may also want set_diagnostics = true and/or items_only = true. Then for open_output, set on_complete = "success". The combination of these two will open the quickfix if there are errors (technically, if the command has a nonzero exit code), and open the terminal output if it succeeds.

@stevearc stevearc added the question Further information is requested label Jan 5, 2025
@EnDeRGeaT
Copy link
Author

Oh, that is very nice. Thank you. By the way, is there any way to change the size of open_output terminal? I saw that there is a terminal strategy with size, but there is nothing like that for open_output.

@github-actions github-actions bot removed the question Further information is requested label Jan 6, 2025
@stevearc
Copy link
Owner

stevearc commented Jan 7, 2025

No, open_output doesn't support that at the moment. I'd be willing to review a PR that added that capability, though

@stevearc stevearc added the question Further information is requested label Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants