fix(lsp): Set dir completion option for add_workspace_folder

Given that the input is pre-filled with a path, it should be possible to
use dir completion.
This commit is contained in:
Mathias Fussenegger 2021-06-25 14:23:53 +02:00
parent 510ed996d2
commit 7ea652e4bf

View File

@ -339,7 +339,7 @@ end
--- Add the folder at path to the workspace folders. If {path} is --- Add the folder at path to the workspace folders. If {path} is
--- not provided, the user will be prompted for a path using |input()|. --- not provided, the user will be prompted for a path using |input()|.
function M.add_workspace_folder(workspace_folder) function M.add_workspace_folder(workspace_folder)
workspace_folder = workspace_folder or npcall(vfn.input, "Workspace Folder: ", vfn.expand('%:p:h')) workspace_folder = workspace_folder or npcall(vfn.input, "Workspace Folder: ", vfn.expand('%:p:h'), 'dir')
vim.api.nvim_command("redraw") vim.api.nvim_command("redraw")
if not (workspace_folder and #workspace_folder > 0) then return end if not (workspace_folder and #workspace_folder > 0) then return end
if vim.fn.isdirectory(workspace_folder) == 0 then if vim.fn.isdirectory(workspace_folder) == 0 then