lukehoban / atom-ide-flow

Atom IDE support for Flow
MIT License
87 stars 17 forks source link

Function signature tooltip not shown #25

Closed rainboxx closed 9 years ago

rainboxx commented 9 years ago

The function signature tooltip is only shown when there already has been a call to the function within the same file.

Given the example of flow:

/* @flow */

function foo(x) {
  return x * 10;
}

foo('Hello, world!');

When I type foo after the last line, the tooltip is shown. Once I comment out the foo-call and start writing foo, a autocomplete is shown suggesting the word foo, not the function with its signature.

Is this an issue of flow it atom-ide-flow?


Log output from console when writing foo while already having a call to foo in the file:

[{"name":"foo","type":"(x: string) => number","func_details":{"return_type":"number","params":[{"name":"x","type":"string"}]},"path":"/Users/.../test.js","line":3,"endline":5,"start":1,"end":1},{"name":"exports","type":"{}","func_details":null,"path":"","line":0,"endline":0,"start":0,"end":-1}]

Log output from console when writing foo while having no call to foo already in file:

[{"name":"foo","type":"","func_details":{"return_type":"number","params":[{"name":"x","type":""}]},"path":"/Users/md/Documents/workspace/vt/vt-app2/test.js","line":3,"endline":5,"start":1,"end":1},{"name":"exports","type":"{}","func_details":null,"path":"","line":0,"endline":0,"start":0,"end":-1}]
rainboxx commented 9 years ago

Thanks for the changes! :)