diff options
| author | Gaetan Lepage <gaetan@glepage.com> | 2025-12-12 01:02:53 +0100 |
|---|---|---|
| committer | Matthieu Coudron <886074+teto@users.noreply.github.com> | 2025-12-12 15:18:28 +0100 |
| commit | a3fc01c6f521fd680ac53d18cd297e9098a43526 (patch) | |
| tree | 597d09ccf0397f87894e57003210b957656d141b | |
| parent | docs: update configs.md (diff) | |
| download | nvim-lspconfig-a3fc01c6f521fd680ac53d18cd297e9098a43526.tar nvim-lspconfig-a3fc01c6f521fd680ac53d18cd297e9098a43526.tar.gz nvim-lspconfig-a3fc01c6f521fd680ac53d18cd297e9098a43526.tar.bz2 nvim-lspconfig-a3fc01c6f521fd680ac53d18cd297e9098a43526.tar.lz nvim-lspconfig-a3fc01c6f521fd680ac53d18cd297e9098a43526.tar.xz nvim-lspconfig-a3fc01c6f521fd680ac53d18cd297e9098a43526.tar.zst nvim-lspconfig-a3fc01c6f521fd680ac53d18cd297e9098a43526.zip | |
feat(flow): use flow executable for cmd if available in PATH
| -rw-r--r-- | lsp/flow.lua | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lsp/flow.lua b/lsp/flow.lua index 50568317..92743816 100644 --- a/lsp/flow.lua +++ b/lsp/flow.lua @@ -14,7 +14,16 @@ ---@type vim.lsp.Config return { - cmd = { 'npx', '--no-install', 'flow', 'lsp' }, + cmd = function(dispatchers) + local cmd = nil + if vim.fn.executable('flow') then + cmd = { 'flow', 'lsp' } + else + cmd = { 'npx', '--no-install', 'flow', 'lsp' } + end + + return vim.lsp.rpc.start(cmd, dispatchers) + end, filetypes = { 'javascript', 'javascriptreact', 'javascript.jsx' }, root_markers = { '.flowconfig' }, } |
