mirror of
https://github.com/neovim/neovim.git
synced 2025-12-16 03:15:39 +00:00
feat(lsp): add a start function (#18631)
A alternative/subset of https://github.com/neovim/neovim/pull/18506 that should be forward compatible with a potential project system. Configuration of LSP clients (without lspconfig) now looks like this: vim.lsp.start({ name = 'my-server-name', cmd = {'name-of-language-server-executable'}, root_dir = vim.fs.dirname(vim.fs.find({'setup.py', 'pyproject.toml'}, { upward = true })[1]), })
This commit is contained in:
committed by
GitHub
parent
61e33f312e
commit
69774e3179
@@ -37,6 +37,9 @@ end
|
||||
---@param file (string) File or directory
|
||||
---@return (string) Parent directory of {file}
|
||||
function M.dirname(file)
|
||||
if file == nil then
|
||||
return nil
|
||||
end
|
||||
return vim.fn.fnamemodify(file, ':h')
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user