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

FindInDependencyJars doesn't work #637

Open
Z1kkurat opened this issue Jan 3, 2024 · 8 comments
Open

FindInDependencyJars doesn't work #637

Z1kkurat opened this issue Jan 3, 2024 · 8 comments

Comments

@Z1kkurat
Copy link

Z1kkurat commented Jan 3, 2024

Describe the bug

MetalsFindInDependencyJars command doesn't seem to work. After showing the input for file mask and text, nothing happens. I found no errors in metals' log file. The same use case works fine in vscode, so it doesn't seem the issue is in metals itself.

Can be reproduced by adding "com.typesafe.akka" %% "akka-actor" % "2.6.13" to the project's dependencies, file mask should be .conf, query should be akka.
out

I use lazyvim if that makes any difference.

Expected behavior

A window/popup with the search results

Operating system

macOS

Version of Metals

1.2.0

Commit of nvim-metals

1e269f1

@antosha417
Copy link
Contributor

antosha417 commented Jan 3, 2024

Hey @Z1kkurat! Thank you for opening this issue

I just checked it work as expected for me. I'm still using packer. I ran Update Metals command just to be sure that I'm on the latest version.
Screenshot 2024-01-03 at 23 43 23

Do you by any chance have this line in your config? Maybe it is interfering with the search

        excludedPackages = { "akka.actor.typed.javadsl", "com.github.swagger.akka.javadsl" },

We can also try to reproduce with minimal neovim config.

@antosha417
Copy link
Contributor

antosha417 commented Jan 3, 2024

I just tested with this example config nvim -u minimal_config.lua
And indeed results of the search are added to quick fix list after removing said line

        excludedPackages = { "akka.actor.typed.javadsl", "com.github.swagger.akka.javadsl" },

@Z1kkurat
Copy link
Author

Z1kkurat commented Jan 4, 2024

Hi @antosha417, thanks for taking a look! Indeed, I had excludedPackages in my config, but removing it doesn't change anything for me, and the quickfix list stays empty. Is there anything else I can take a look at? Maybe some debug logs?

@antosha417
Copy link
Contributor

I'm not sure about debug logs, sorry.

I would start with the example config. Make sure it does work for you.
Just copy it to minimal_config.lua. Than you can run nvim with following command nvim -u minimal_config.lua
After that, you can change example config bit by bit to resemble your original config. And see what breaks it.

@Z1kkurat
Copy link
Author

Z1kkurat commented Jan 4, 2024

I found what was causing the issue for me. Somehow it doesn't work if neovim is started by calling nvim from the project's directory. However, if I start it like this nvim . (note the dot), then the functionality works as expected with the quickfix list. Both commands were executed while being in the project's directory, everything else was the same.

@ckipp01
Copy link
Member

ckipp01 commented Jan 7, 2024

I found what was causing the issue for me. Somehow it doesn't work if neovim is started by calling nvim from the project's directory. However, if I start it like this nvim . (note the dot), then the functionality works as expected with the quickfix list. Both commands were executed while being in the project's directory, everything else was the same.

Can you include the exact commands of what you mean. I just tried with opening a project just with nvim first and it worked the same as doing nvim .. Do you mean that you just do nvim and then the command? If so, then Metals won't actually be started at as as the autocommand to start it was never triggered. Is that what you mean or do you mean something else?

@Z1kkurat
Copy link
Author

Z1kkurat commented Jan 7, 2024

@ckipp01 exact sequence of commands:

  1. cd into project directory
  2. run nvim
  3. open build.sbt to start metals
  4. execute MetalsFindInDependencyJars

This results in...nothing, just like in the GIF I've attached to the issue. Text inputs are shown, but nothing happens afterwards.
However, if step 2 is "run nvim .", then it works as expected, and a quickfix window is opened with results.

@ckipp01
Copy link
Member

ckipp01 commented Feb 15, 2024

Hey @Z1kkurat sorry this has sat here for a while. Just getting back to it and testing exactly you have listed, I still can't reproduce with a minimal config. So I honestly have no idea how to move forward without being able to reproduce. Once the build is imported you should totally see this working.

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

No branches or pull requests

3 participants