Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aaronjensen/company-flow
https://github.com/aaronjensen/company-flow
emacs flow flycheck melpa
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/aaronjensen/company-flow
- Owner: aaronjensen
- Created: 2016-08-28T15:21:13.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-02-25T22:00:01.000Z (almost 7 years ago)
- Last Synced: 2024-10-11T03:17:39.301Z (4 months ago)
- Topics: emacs, flow, flycheck, melpa
- Language: Emacs Lisp
- Size: 20.5 KB
- Stars: 33
- Watchers: 3
- Forks: 9
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Company flow [![MELPA](https://melpa.org/packages/company-flow-badge.svg)](https://melpa.org/#/company-flow)
[Flow][] backend for [company-mode][]. Flow-based autocomplete for Emacs.
## Installation
You can install this package from [Melpa][]
```
M-x package-install RET company-flow RET
```## Usage
Ensure that `flow` is in your path.
Add to your company-backends for your preferred javascript modes,
for example:```elisp
(eval-after-load 'company
(add-to-list 'company-backends 'company-flow))
```## Configuration
### `company-flow-executable`
Buffer local variable that should point to the flow executable. Defaults to
`"flow"`. Set to `nil` to disable `company-flow`.For best performance, you can set this to the actual flow binary in your
project. Here's one way to do that:```elisp
(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 company-flow-executable executable)
;; These are not necessary for this package, but a good idea if you use
;; these other packages
(setq-local flow-minor-default-binary executable)
(setq-local flycheck-javascript-flow-executable executable)));; Set this to the mode you use, I use rjsx-mode
(add-hook 'rjsx-mode-hook #'flow/set-flow-executable t)
```### `company-flow-modes`
List of major modes where `company-flow` should provide completions if it is
part of `company-backends`. Set to `nil` to enable `company-flow` for all major modes.## Thanks
* [@proofit404][] for a nice example backend with [company-tern][].
* [@dgutov][] for [company-mode][] and lots of feedback.
* [@lunaryorn][] for the process communication code from [flycheck][].[Flow]: https://flowtype.org/
[company-mode]: https://company-mode.github.com
[@proofit404]: https://github.com/proofit404
[@dgutov]: https://github.com/dgutov
[@lunaryorn]: https://github.com/lunaryorn
[company-tern]: https://github.com/proofit404/company-tern
[flycheck]: https://github.com/flycheck/flycheck
[Melpa]: http://melpa.milkbox.net/