diff --git a/modules/neovim/ftplugin/cs.lua b/modules/neovim/ftplugin/cs.lua index f7b5880..d42cbef 100644 --- a/modules/neovim/ftplugin/cs.lua +++ b/modules/neovim/ftplugin/cs.lua @@ -5,7 +5,7 @@ ---@field target_framework string ---@class CSFTPlugin.LaunchOptions: dap.Configuration ----@field cwd string? +---@field cwd string ---@field program (fun(): thread)? ---@class CSFTPlugin @@ -14,6 +14,7 @@ local M = { dotnet_cmd = vim.fn.exepath "dotnet", launch_options = { + cwd = "${env:CSPROJ_LOCATION}", name = "Launch project DLL", request = "launch", type = "netcoredbg", @@ -59,14 +60,14 @@ function M.find_projects() local sub_start, sub_end = string.find(file_path, "%w+%" .. csproj_extension) local project_name = string.sub(file_path, sub_start or 1, sub_end - #csproj_extension) - local project_path = vim.fn.simplify(vim.fn.getcwd() .. "/" .. string.sub(file_path, 1, sub_start - 1)) + local project_location = string.sub(file_path, 1, sub_start - 1) local target_framework = M.cmd("rg -e 'TargetFramework>(.*)<' -r '$1' -o " .. file_path)[1] projects[#projects + 1] = { - dll_path = project_path .. "bin/Debug/" .. target_framework .. "/" .. project_name .. ".dll", + dll_path = "bin/Debug/" .. target_framework .. "/" .. project_name .. ".dll", name = project_name, - project_path = project_path, + project_path = vim.fn.simplify(vim.fn.getcwd() .. "/" .. project_location), target_framework = target_framework, } end @@ -115,9 +116,10 @@ function M:choose_dll() if path ~= dap.ABORT then self:run "build" - self.launch_options.cwd = item.project_path end + vim.fn.setenv("CSPROJ_LOCATION", item.project_path) + coroutine.resume(search_coroutine, path) end ) diff --git a/modules/neovim/lua/community.lua b/modules/neovim/lua/community.lua index b752202..0f3cda3 100644 --- a/modules/neovim/lua/community.lua +++ b/modules/neovim/lua/community.lua @@ -15,7 +15,6 @@ return { { import = "astrocommunity.motion.mini-ai" }, { import = "astrocommunity.motion.mini-surround" }, - { import = "astrocommunity.recipes.astrolsp-no-insert-inlay-hints" }, { import = "astrocommunity.recipes.diagnostic-virtual-lines-current-line" }, { import = "astrocommunity.test.neotest" },