Skip to content

Instantly share code, notes, and snippets.

@knu
Last active February 28, 2020 12:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save knu/7821a069e49fab36693f80d8a690e7d9 to your computer and use it in GitHub Desktop.
Save knu/7821a069e49fab36693f80d8a690e7d9 to your computer and use it in GitHub Desktop.
Using flow installed under node_modules in lsp-mode
(with-eval-after-load 'lsp
(defun my-lsp-search-node_modules ()
(and buffer-file-name
(lsp-clients-flow-activate-p buffer-file-name major-mode)
(let* ((flow-location "node_modules/.bin/flow")
(root (locate-dominating-file buffer-file-name flow-location)))
(if root
(set (make-local-variable 'lsp-clients-flow-server)
(expand-file-name flow-location root))))))
(add-hook 'lsp-mode-hook #'my-lsp-search-node_modules))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment