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

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

Open
Cliffback opened this issue Feb 16, 2024 · 1 comment
Open

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

Cliffback opened this issue Feb 16, 2024 · 1 comment

Comments

@Cliffback
Copy link

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
Copy link

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

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

No branches or pull requests

2 participants