Last active
February 28, 2020 12:41
-
-
Save knu/7821a069e49fab36693f80d8a690e7d9 to your computer and use it in GitHub Desktop.
Using flow installed under node_modules in lsp-mode
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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