Skip to content
This repository has been archived by the owner on Dec 13, 2018. It is now read-only.

Autocomplete quality on the level of basic text editor #1619

Open
akomm opened this issue Sep 19, 2018 · 0 comments
Open

Autocomplete quality on the level of basic text editor #1619

akomm opened this issue Sep 19, 2018 · 0 comments

Comments

@akomm
Copy link

akomm commented Sep 19, 2018

Issue and Steps to Reproduce

Create file src/App.js and type, /* @flow */ at the top implied:

class App extends Reac| // ctrl+space

Completion proposal: nothing.
Continue:

class App extends React.PureComponent {
}| // ctrl+s

Diagnostic:

// Cannot resolve name `React`
class App extends |React|.PureComponent {
}

Mouse over |React| shows the same diagnostic message in a tooltip, without any extras like "import".
Continue with manual import attempt:

i| //ctrl+space - ide, if, ife, iife, inspect, interval
im| //ctrl+space - nothing
import * as React | // ctrl+space - nothing
import * as React fro | //ctrl+space - nothing
import * as React from '|' //ctrl+space - nothing

class App extends React.PureComponent {
}

Continuing the above leads to nothing, but accidental primitive keyword hits from some other files or shortcuts, like "req", etc.

Continue saving (ctrl+s):

import * as React from 'react';

// Cannot use property `PureComponent` [1] with less than 1 type argument.
class App extends |React.PureComponent| {
}

So typechecking via flow-bin is the only thing that works. Specifying the generic type(s) removes the error.

Basically everything works like this. The only completion I get is randomly fetched symbols, keywords and shortcuts. So yes, when I create a class AppGrid, it will propose me in JSX to complete App| to AppGrid, but without any understanding of the components props.

Last, a bit different example:

/* @flow */
import * as React from 'react';

type Props = {
  property: string,
};

class App extends React.PureComponent<Props, void> {
  render() {
    return (
      <div>{this.props.p|}</div> //ctrl+space - "property" hidden between generic props
    );
  }
}

Not even sure if the "property" above is recognized correctly as member of props, because it does not show up at the top and has no letter indicating the elements type (like C for class). And I have show flow autocomplete results first enabled!

edit:
With cursor at this.p| in the above example It does not propose "props", instead some generic stuff and "Props", which is dumb symbol name proposal from the type Props defined above, not flow.

Expected Behavior

Autocomplete/import in given examples

Actual Behavior

Tell us what happens instead.

Versions

  • Atom: 1.30.0
  • Nuclide: 0.349.0
  • Client OS: Linux
  • Server OS (optional):

Additional Details

  • Installed packages (apm ls --installed):
    ├── file-icons@2.1.24
    ├── highlight-selected@0.14.0
    ├── language-babel@2.85.0
    ├── language-graphql@0.10.1
    ├── language-ini@1.20.0
    ├── nuclide@0.349.0
    └── nuclide-format-js@0.0.47
  • nuclide-js-imports-client settings
    • Component Module Path Filter: src
  • nuclide-flow settings
    • Use projects flow-bin
    • Use flow autocomplete results first
  • node: v10.1.0
  • .flowconfig blank in project root
  • local evtl. relevant dev-dependencies
    • flow-bin
    • babel-cli
    • babel-preset-flow
    • react
    • react-dom
@akomm akomm changed the title Autocomplete level on the level of basic text editor Autocomplete quality on the level of basic text editor Sep 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant