flow / vim-flow Goto Github PK
View Code? Open in Web Editor NEWA vim plugin for Flow
License: Other
A vim plugin for Flow
License: Other
The issue: vim-flow auto-closes the path window (I think that's the correct name for it?) on save
To repeat:
Ag
something to bring up the list of resultsResult: the search results window closes.
Expected behaviour: the search results window does not change
What I've tried: various permutations of g:flow#autoclose
and g:flow#showquickfix
I was wondering if it's possible to implement a feature which allows you to go to the definition of the word under the cursor?
When I use FlowMake
or :w
in vim, flow will check all the file of the projects.
How can I only check the file editing, and not the other things.
flow check-contents < path/to/file.js
works mentioned in facebook/flow#1451.
Am I missing something in vim-flow?
Any advice is appreciated.
I always wanted to tackle this, so I might as well create an issue here...
The Vim-Plugin should initially look if there is a node_modules/.bin/flow
binary, before trying to use the globally installed one.
I've installed vim-flow and the type checking is working but I can seem to get completion working. I've tired the basic and also YouCompleteMe but it does not seem to work.
I'm sure I have not set it up correctly, does anyone have an example vimrc they wish to share.
At the moment when I look up a type of a variable under cursor with :FlowType
the output in a split is in a single line and is not well readable, I have not found a toggle to show the type of the variable under the cursor in a more readable manner. Is there a way to get such behaviour at the moment?
Perhaps this can be a feature request
Please see the screenshot for reference. Using the following .vimrc
filetype indent plugin on
syntax on
set ts=2
set sw=2
set autoindent
set expandtab
set number
set ruler
execute pathogen#infect()
set clipboard=unnamedplus
set nowrap
let g:javascript_plugin_flow = 1
let g:jsx_ext_required = 0
Parsing seems to break down when using generics on React component classes. The file shown in the screenshot passes flow checks and compiles without issue, but the red highlighted text indicates a syntax error and highlighting is off in a few places. Hopefully I'm just doing something wrong.
First, thanks for your hard work.
In the flow examples, it works fine. I hit save, and the quick-check window pops up with the errors.
In my real project, I added a .flowconfig
. Running flow
on the command-line works great, and running :FlowMake
in vim also works as expected. But for some reason it doesn't redo type checks when I save.
Here's my .flowconfig
[ignore]
[include]
./client
[libs]
./interfaces
[options]
Project structure:
client/
app/
app.jsx
index.jsx
interfaces/
globals.js
node_modules/
etc
Similar to the syntastic plugin (and experience in Nuclide, I think) it would be nice to use the new focus-check
command in Flow v0.48 to speed up response time and focus the results on the current buffer.
The timeout feature (g:flow#timeout
) is documented in the readme, but not in the Vim docs. Anyone using those docs instead of the readme will not be aware of this feature.
Highlight this code correctly:
type Test2<A> = A;
type Test = Test2<{}>;
type Test3 = string;
The error output is really hard to read. Specifically, errors usually span 3 lines, and vim-flow currently identifies the 3rd line as another error, when it is extra information about the current error.
Could we indent that 3rd line and not have it appear as another error?
I would also suggest remove the ||
between lines.
For a great example to follow, see this typescript plugin: https://github.com/leafgarland/typescript-vim
If I try using :FlowJumpToDef
on an name that is eventually not found, it sometimes takes on the order of 2 min or more to fail. This is confusing because I thought there was a timeout. Anyone else experience this issue?
I am using Neovim 0.1.7
Relavant .vimrc
"" Vim-flow
let g:flow#enable = 0
if len(exepath(s:flow_path)) > 0
let g:flow#flowpath = s:flow_path
endif
nmap <localleader>] :FlowJumpToDef<CR>
I have the vim plugin installed and I have flow working (that is, running flow
on the command line works). But I still get an empty Quickfix list when I save a .js
file.
My vim is:
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled May 22 2014 12:15:44)
MacOS X (unix) version
Included patches: 1-306
Flow version is:
Flow, a static type checker for Javascript, version 0.1.0
Any ideas about this. I feel like I have something misconfigured, but I can't figure out what.
I seem to be getting this consistent error:
Flow timed out, please try again!
Error detected while processing function flow#typecheck:
line 10:
E777: String or List expected
Press ENTER or type command to continue
Flow works perfectly fine if I run it at the command line, so I'm surprised to see that it is 'timing out'
I actually have no idea how to debug this further, so any assistance would be appreciated.
This plugin in its current form leaves much to be desired. There are many unaddressed Issues/PR's. The broken, multiline output (#11) renders this plugin almost unusable.
Is this project dead? Are there any plans to pass ownership to either pass ownership to someone else or bless someone’s fork?
Hi!
vim-flow
is working nicely for me, got autocomplete working too 😄
I'm having an issue though where the Quickfix window is including all the stuff listed below:
flowType: ^[]4;0;rgb:00/2b/36^[\^[]4;1;rgb:dc/32/2f^[\^[]4;2;rgb:85/99/00^[\^[]4;3;rgb:b5/89/00^[\^[]4;
4;rgb:26/8b/d2^[\^[]4;5;rgb:6c/71/c4^[\^[]4;6;rgb:2a/a1/98^[\^[]4;7;rgb:93/a1/a1^[\^[]4;8;rgb:65/7b/83^
[\^[]4;9;rgb:dc/32/2f^[\^[]4;10;rgb:85/99/00^[\^[]4;11;rgb:b5/89/00^[\^[]4;12;rgb:26/8b/d2^[\^[]4;13;rg
b:6c/71/c4^[\^[]4;14;rgb:2a/a1/98^[\^[]4;15;rgb:fd/f6/e3^[\^[]4;16;rgb:cb/4b/16^[\^[]4;17;rgb:d3/36/82^
[\^[]4;18;rgb:07/36/42^[\^[]4;19;rgb:58/6e/75^[\^[]4;20;rgb:83/94/96^[\^[]4;21;rgb:ee/e8/d5^[\^[]Pg93a1
a1^[\^[]Ph002b36^[\^[]Pi93a1a1^[\^[]Pj586e75^[\^[]Pk93a1a1^[\^[]Pl93a1a1^[\^[]Pm002b36^[\(unknown)
I'm assuming this is a neovim issue as i've not seen it reported elsewhere, do you know of a fix?
Thanks!
It seems like the new error output from Flow 0.66 is causing this plugin to break.
Hello,
what would be the requirements for a new maintainer, if one was ever to apply for the position.
I understand that it is difficult to maintain projects, for which the time or interest subsided and who doesn't dread these Is this still maintained issues?
So if somebody is willing to step up and start maintenance of this project, what would be the appropriate steps?
Let's just imagine I would apply for the role as maintainer (hintity-hint-hint), what do I need to do/what do I need to have as requirements to do this? Should I fork this project, start maintaining it and then one of the original maintainers gets in touch with me? Or should I stalk the maintainers and write them on social media? I can do both... 😄
The plugin uses a call to timeout
, a util available on linux but not on a mac. @dsereni is adding a --timeout flag to fix this and remove the need for timeout
If possible to parse JSON in vimscript (or via a wrapper script?) it would be better to call flow
with --json
and format errors appropriately within vim-flow
. The CLI format is lossy compared to JSON, especially in the presence of traces, so we can probably parse it more accurately starting from JSON.
It would be nice to have a built into plugin support for automatically typechecking not only .js
files but also .jsx
. I imagine many projects using flow use it together with react
which uses this filetype.
It also relates to the issue #10.
It should be pretty easy to implement that.
I have the plugin installed but none of the commands exist i.e. FlowMake
. I can echo out the value of some variables:
:echo g:flow#enable
1
But not others:
:echo g:flow#omnifunc
E121: Undefined variable: g:flow#omnifunc
E15: Invalid expression: g:flow#omnifunc
Minimal vimrc:
call plug#begin()
Plug 'flowtype/vim-flow'
call plug#end()
Any ideas?
Sorry if this is the wrong place to ask. Would be super useful to generate ctags to make it easier to navigate types in vim.
The documentation for FlowMake
says:
Triggers a type check for the current file.
Running this command shows failed type checks for all files in the repo. Looking at the source it appears this is the expected behavior? If so, the documentation should say something like 'Triggers a type check for all annotated files.'
When I suppress error with $FlowFixMe
it is still shown. For example:
// @flow
// $FlowFixMe: suppressing this error until we can refactor
var x : string = 123;
Then I can see || This type is incompatible with test.js|3 col 9 error| string
in quickfix list
I'm using neovim with vim-plug as my package manager. I successfully installed the plugin after adding the following in my config file:
Plug 'flowtype/vim-flow', {
\ 'autoload': {
\ 'filetypes': 'javascript'
\ },
\ 'build': {
\ 'mac': 'npm install -g flow-bin'
\ }}
let g:flow#flowpath = '$(npm bin)/flow'
However, flow is not running at all when after I save a file, and when I run the :FlowMake
command I get the following error:
E402: Not an editor command: FlowMake
I'm kind of a vim noob so any help would be appreciated!
I believe the latest version of vim has changed a few things in regards to quickfix.
With this plugin installed, anytime the quickfix is triggered (usually from another plugin or command), I get the following error:
Error detected while processing function <SNR>83_AdjustWindowHeight:
line 1:
E788: Not allowed to edit another buffer now
The ftplugin to enable the omnifunc autocompletion is "js", but for JavaScript this is usually "javascript"?
NeoBundleLazy is not recognized by vim8.0.
/** @flow */
var x = ‘abc';
x.<C-x><C-o>
vim says “Omni completion (^O^N^P) Pattern not found”
I've installed vim-flow in ~/.vim/bundle/vim-flow
and am installing it using Pathogen.
Sorry, I know this isn't the most original issue ever, but I seem to get nothing in my quickfix buffer, but only in some projects. When I type flow .
in those projects, I get reasonable responses. An example of one below:
Launching Flow server for /home/ben/aplus-analytics-dash
Spawned flow server (pid=21324)
Logs will go to /tmp/flow/zShomezSbenzSaplus-analytics-dash.log
No errors!
The quickfix box is open, but it's empty. :FlowType
returns essentially nothing. flow version
gives me 0.32.0.
Any advice or knowledge?
When autocompleting on objects, flow will show all possible options in alphabetical ordering.
Most of the times users are interested in the properties they defined on the object and not ALL existing properties. It would be useful to sort these to reflect this.
For example, considering the following object:
type Action = {type: string, payload: any}
If I autocomplete on this I probably want type
or payload
, but flow will present me with hasOwnProperty
, isPrototypeOf
, etc.. and type
will be one of the last available options (sorted alphabetically).
I am monitoring this project for quite a while now because I am actively using it. There are currently almost 10 open PRs. Is somebody taking care of this repo? Are you too busy and need help?
I'd like to set up vim to show my code on the left and the errors on the right. I can do this by splitting my window and doing :copen
to open the quickfix window on the right. When I save, however, things get crazy:
(click through for video)
Is it possible to set up this configuration?
I'm using vim-flow with neosnippet & neocomplete. Everything works correctly but I cannot figure out how to expand function prototype. When I try to expand a function only its name is inserted.
It's possible that it's just the matter of configuration. If that's the case sorry for bothering you.
Otherwise - if it's not implemented, let me know. I'll try to implement it and submit a PR.
I would love it if the type annotations adopted the current colorscheme's comment color. Currently, it feels quite cluttered, and it's sometimes hard to see what is Flow and what is not.
I'm thinking this isn't really the right repo for this, but couldn't find a better one and I haven't had time to give it a shot myself, but I'm hoping someone here will see it and either implement it here or separately.
Some good starting points might be reading Writing Vim Syntax Plugins and Creating your own syntax files, and looking at repos like vim-jsx, vim-javascript, and vim-es6 since they seem to do a similar thing as would be desired here, i.e., extending the base JavaScript syntax.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.