-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support local flow-bin #12
Comments
I use this: (defun flow/set-flow-executable ()
(interactive)
(let* ((os (pcase system-type
('darwin "osx")
('gnu/linux "linux64")
(_ nil)))
(root (locate-dominating-file buffer-file-name "node_modules/flow-bin"))
(executable (car (file-expand-wildcards
(concat root "node_modules/flow-bin/*" os "*/flow")))))
(setq-local flow-minor-default-binary executable)
(setq-local company-flow-executable executable)
(setq-local flycheck-javascript-flow-executable executable)))
(add-hook 'rjsx-mode-hook #'flow/set-flow-executable t) I'm not sure about supporting this in the library out of the box, but maybe that'd be ok. |
Thanks for sharing this snippet! I'll certainly be using this myself. From what I've seen, I know many people prefer using local bins whenever possible. Using From a design philosophy, why not support a variable for activating the preference? E.g. - (setq company-flow-prefer-local-bin t) |
Personally, I wouldn't use
Using the bin for flow directly is slower as well. That's why I path to the actual binary. For this library, building that in may make sense since the logic is somewhat complicated and it makes a big difference in the performance/usability of company-flow. |
I updated the readme w/ the snippet. Hopefully that helps some people, but I'll still consider building this in. |
Thanks for the explanation. I think I share your concerns about the time that |
Any plans to support the local
flow-bin
executable via something likenpx flow ...
? That would be nice, so that project-specificflow-bin
versions could be used instead of depending on a globally installed version. Other editor tools in thenpm
ecosystem support this if we need to draw from a precedent.The text was updated successfully, but these errors were encountered: