project.nvim icon indicating copy to clipboard operation
project.nvim copied to clipboard

Support for Wrokspace Folders + embedded projects

Open kkrime opened this issue 10 months ago • 7 comments

kkrime avatar Jan 07 '25 05:01 kkrime

@kkrime Quick question: I tried this plugin, via LazyVim, but the list of recent projects remains empty. Is it broken and no longer maintained? Are your PRs being merged here or in another fork?

Thank you!

magnusriga avatar Mar 03 '25 11:03 magnusriga

@magnusriga I'm not sure what's happening with this project tbh, it hasn't been touched by the maintainer in a while, it's looking like it's been abandoned.

I'm not sure what you mean by the list of recent projects remains empty ?

kkrime avatar Mar 03 '25 11:03 kkrime

@magnusriga I'm not sure what's happening with this project tbh, it hasn't been touched by the maintainer in a while, it's looking like it's been abandoned.

I'm not sure what you mean by the list of recent projects remains empty ?

@kkrime Thank you for the quick reply. I tried to run get_recent_projects(), but that table is just empty.

Does that table fill up on your end, when you open files and LSP clients attach?

magnusriga avatar Mar 03 '25 11:03 magnusriga

@magnusriga Ya, it works for me, did you configure detection_methods and patterns?

kkrime avatar Mar 03 '25 11:03 kkrime

@kkrime I am using lazy.nvim and did:

  {
    "kkrime/project.nvim",
    opts = { },
    event = "VeryLazy",
    config = function(_, opts)
      require("project_nvim").setup(opts)
    end,
}

Does it need any other config?

Edit: It is supposed to set detection_methods and patterns automatically, but I also tried adding them explicitly to opts without any effect (get_recent_projects still returns an empty table).

magnusriga avatar Mar 03 '25 12:03 magnusriga

@magnusriga try coping my config https://github.com/kkrime/home/blob/02bf84d93431d4345e0bf07f3a5f6282df9cb257/.config/nvim/lua/plugins/telescope.lua#L10

Also make sure your lsp is running :LspInfo

kkrime avatar Mar 03 '25 13:03 kkrime

@kkrime Thanks for helping me. I found the issue:

  1. copilot.nvim uses cwd as LSP client root, which results in project.nvim never updating its list. That is wrong, in my opinion, so I filed an Issue at that repo. When I added a temporary fix for that root directory, this repo also started working as it should. I also noticed that I could have excluded copilot LSP client witht the ignore_client setting, but decided to instead try to fix that LSP client.
  2. As a side note, I tried your fork but realized that when you fixed the filetype bug in the original repo, the whitelist made it so that no filetypes were accepted. As sucn, I went back to the original repo, which now works as expected due to (1).

Hope that is helpful to others in the future. Thanks again for being so responsive.

magnusriga avatar Mar 03 '25 18:03 magnusriga

@kkrime , @magnusriga

It looks like the maintainer hasn't been active for two years. I created a fork I'm actively maintaining and would love to have your enhancement.

That is, of course, if you want to.

DrKJeff16 avatar Aug 11 '25 18:08 DrKJeff16

@kkrime I am using lazy.nvim and did:

  {
    "kkrime/project.nvim",
    opts = { },
    event = "VeryLazy",
    config = function(_, opts)
      require("project_nvim").setup(opts)
    end,
}

Does it need any other config?

Edit: It is supposed to set detection_methods and patterns automatically, but I also tried adding them explicitly to opts without any effect (get_recent_projects still returns an empty table).

@magnusriga ~I am unsure whether you have this issue, but I've found Lazy-Loading this plugin can lead to buggy behaviour.~

Lazy-Loading seems to be fixed in my fork.

DrKJeff16 avatar Aug 11 '25 18:08 DrKJeff16

@kkrime , @magnusriga

It looks like the maintainer hasn't been active for two years. I created a fork I'm actively maintaining and would love to have your enhancement.

That is, of course, if you want to.

Hey @DrKJeff16, sure feel free to use my code, no worries

@kkrime I am using lazy.nvim and did:

  {
    "kkrime/project.nvim",
    opts = { },
    event = "VeryLazy",
    config = function(_, opts)
      require("project_nvim").setup(opts)
    end,
}

Does it need any other config? Edit: It is supposed to set detection_methods and patterns automatically, but I also tried adding them explicitly to opts without any effect (get_recent_projects still returns an empty table).

@magnusriga I am unsure whether you have this issue, but I've found Lazy-Loading this plugin can lead to buggy behaviour.

I'm not sure what the issue yoru facing is, but here's how I run it;

      {
        'ahmedkhalf/project.nvim',
        config = function()
          require("project_nvim").setup({
            -- line below commented out due to - https://github.com/ahmedkhalf/project.nvim/issues/169
            detection_methods = { "lsp", "pattern" },
            patterns = { ".git", ".gitignore", "README.md", "go.mod", "Makefile" },

            silent_chdir = false,
          })
        end
      },

I would remove event = "VeryLazy", that might be preventing the plugin from loading which might just be the issue.

Good luck 👍

kkrime avatar Aug 12 '25 08:08 kkrime

Hey @DrKJeff16, sure feel free to use my code, no worries

@kkrime Awesome! Will credit you for it, needless to say.


I'm not sure what the issue yoru facing is, but here's how I run it;

      {
        'ahmedkhalf/project.nvim',
        config = function()
          require("project_nvim").setup({
            -- line below commented out due to - https://github.com/ahmedkhalf/project.nvim/issues/169
            detection_methods = { "lsp", "pattern" },
            patterns = { ".git", ".gitignore", "README.md", "go.mod", "Makefile" },

            silent_chdir = false,
          })
        end
      },

I would remove event = "VeryLazy", that might be preventing the plugin from loading which might just be the issue.

Funny thing is I just did some new refactoring today that seemingly fixes that behaviour. Not intentionally, lol.

I'm honestly not sure yet about what piece of code is involved in this.

Essentially, event = 'VeryLazy' appears to be fine now :eyes:

DrKJeff16 avatar Aug 12 '25 08:08 DrKJeff16

Hey guys,

I can't remember what I ended up doing here. I think I moved to the same solution that LazyVim uses, which might have been some snacks.nvim submodule or similar.

I will check back in if it stops working.

Thanks for the effort and input 🥇🚀

magnusriga avatar Aug 12 '25 10:08 magnusriga

@kkrime

Are you interested in recreating this PR in my fork? This repo's author seems unavailable for the foreseeable future.

Also some of the suggested fixes have been adressed there, hopefully making your integration easier to write.

DrKJeff16 avatar Aug 13 '25 20:08 DrKJeff16

@kkrime

Are you interested in recreating this PR in my fork? This repo's author seems unavailable for the foreseeable future.

Also some of the suggested fixes have been adressed there, hopefully making your integration easier to write.

Ya sure, I noticed you've done a lot of refactoring, so I might have a few questions, but ya, I'll get on to it when I get time

kkrime avatar Aug 16 '25 10:08 kkrime