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

.csproj doesn't seem to work as a pattern

Open Cliffback opened this issue 1 year ago • 1 comments

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

Cliffback avatar Feb 16 '24 15:02 Cliffback

@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.

instantepiphany avatar Mar 29 '24 07:03 instantepiphany