Skip to content

Autocomplete results incomplete when including from library. #4066

Open
@MrHus

Description

@MrHus

I have a project which is built using flow and exports the flowtypes via .js.flow files.
The .js.flow files are generated through the flow-copy-source library.

The library is called redux-mad-authentication and it can be found here.

It contains a method called configureAuthentication with the following definition:

export type Config = {
  handshakeUrl: string,
  authenticationUrl: string,
  currentUserUrl: string,
  loginRoute: string,
  dispatch: (Action) => void,
  authenticationStore: () => AuthenticationStore
};

let config: Config | null = null;

export function configureAuthentication(c: Config) {
  config = c;
}

As you can see the argument to configureAuthentication is of type Config. When using the library (through npm) it seems to forget this type.

For example:

may-31-2017 11-49-07

Note how it says that the argument 'c' is of type any.

I've also noticed some strange behaviour when exporting a type twice, for example this is part of the index.js file from the library:

export { configureAuthentication } from './config.js';
export type { Config } from './config.js';

It simply re-exports a type definition from the 'config.js' file.

Now notice the autocomplete when using it from the 'index':

may-31-2017 11-53-40

Versus using the same function from 'redux-mad-authentication/lib/config':

may-31-2017 11-54-34

Note: I'm using vscode in the images with the Flow Langue Support extension but get the same results in Nuclide.

Is this a bug that I'm experiencing or is this a feature request?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions