Vscode-react-native: I encounted the issue #306

Created on 29 Jul 2017  路  6Comments  路  Source: microsoft/vscode-react-native

Actual Behavior

  1. When I use VSCode to open a project that initilized by https://github.com/react-community/create-react-native-app,
    I encounted the issue #306
  2. the style intellSense do not work in component tag鈥榮 style prop() , but not in stylesheet.creator({})
  3. the function/method intellSense work well
    1\
    2

Expected Behavior



    1. 2.

Software versions

  • React Native Tools extension version: 0.4.0
  • VSCode version: 1.14.2
  • OS platform and version: both macOS 10.12.5 and windows 10
  • NodeJS version: 6.10.0
  • React Native version: 0.46.4
external triaged wontfix

Most helpful comment

@Tonyhark thanks for reporting - I was able to repro this, but an interesting observation is that if you trigger suggestion first (by pressing Ctrl+Space) all available property names are showed in suggestions list - see below

image

which sounds more like an issue with typescript engine that doesn't yield completions under some specific circumstances.

Also since we don't manage typings in this extension and completely rely on typescript and VSCode I doubt we can do anything here - I believe that Microsoft/Typescript repository would be a better place to file this issue.

All 6 comments

@Tonyhark thanks for reporting - I was able to repro this, but an interesting observation is that if you trigger suggestion first (by pressing Ctrl+Space) all available property names are showed in suggestions list - see below

image

which sounds more like an issue with typescript engine that doesn't yield completions under some specific circumstances.

Also since we don't manage typings in this extension and completely rely on typescript and VSCode I doubt we can do anything here - I believe that Microsoft/Typescript repository would be a better place to file this issue.

@Tonyhark could you please confirm that you're seeing the same behavior? Also, if there would be no objections I'm going to close this ticket in a couple of days.

@Tonyhark any updates? If you don't have any objections, I'm going to close this

@vladimir-kotikov I can confirm i get the same behaviour,
no suggest while typing, but i got all the list with Ctrl+Space

i have typescript 2.4.2 installed globally and also in the project folder

thank you!

@gino8080 thanks for confirmation. Closing this

I know this issue is closed but for more information I get very strange issue
I figure out its because of index.d.ts in react-native types in create method

So I change the type for test from
export function create<T extends NamedStyles<T> | NamedStyles<any>>(styles: T): T;
to
export function create<T extends NamedStyles<T> | NamedStyles<any>>(styles: { [P in keyof T]: ViewStyle | TextStyle | ImageStyle }): T;

I change style: T to actual type.

So now I get hint for style all styles except the first one!
In my case my first one is container So I did not get any hint for this but for other it's work perfect!

Was this page helpful?
0 / 5 - 0 ratings