ahmedkhalf / project.nvim

The superior project management solution for neovim.
Apache License 2.0
1.29k stars 119 forks source link

.csproj doesn't seem to work as a pattern #146

Open Cliffback opened 4 months ago

Cliffback commented 4 months ago

I have a dotnet solution, with subprojects in it, and with project.nvim's default settings, I would always auto cd to the solution root. However to be able to build using for example compiler.nvim, I need to cd into the correct subproject folder with a .csproj file in it. I have tried to rearrange so that "pattern" is prioritized over "lsp", and ".csproj" as the first pattern. But it doesn't seem to work, and falls back on the lsp. Inside the same solution, I also have a web project, and both the package.json and the js lsp works fine. It is just the .csproj pattern that I can't get to work.

Is this a bug, or have I done something wrong?

  {
    "ahmedkhalf/project.nvim",
    config = function()
      require("project_nvim").setup {
        -- your configuration comes here
        -- or leave it empty to use the default settings
        -- refer to the configuration section below
        manual_mode = true,
        detection_methods = { "pattern", "lsp" },
        patterns = { ".csproj", "package.json" },
        silten_chdir = false,

      }
    end
  },

Cheers

instantepiphany commented 3 months ago

@Cliffback this works for me, as long as I have pattern before lsp, or remove lsp.

Your config also has a typo silten_chdir - that might be causing problems.

I recommend copying the default config into your config, adding .csproj to the patterns list, and reversing the order of pattern and lsp. This worked for me.

If that still has issues, you could check the permissions on the directories and files involved.