Skip to content

IntelliSense for StyleSheet #306

Closed
Closed

Description

@dev-xdyang

Actual Behavior

  1. not show IntelliSense for StyleSheet key
    2016-09-24 10 30 28
  2. not show IntelliSense for StyleSheet value
    2016-09-24 10 31 03
  3. func IntelliSense always show when I edit the StyleSheet
    2016-09-24 10 31 13

Expected Behavior

  1. support IntelliSense for StyleSheet key. for Instance, when I input "align", I expect get "alignItems" IntelliSense
  2. support IntelliSense for StyleSheet available value for given key. for Instance, when I input "alignItems: ", I expect IntelliSense are flex-start, center, flex-end, and stretch
  3. don't show func IntelliSense when I edit StyleSheet

Software versions

  • React-Native VS Code extension version: 0.2.0
  • VSCode version: 1.5.3
  • OS platform and version: MacOS 10.11.6
  • React Native version: 0.34

Activity

  1. billti commented on Oct 10, 2016

    @billti
    Member

    This is an issue with the types defined in the DefinitelyTyped repo (e.g. for the above see https://github.com/DefinitelyTyped/DefinitelyTyped/blob/types-2.0/react-native/index.d.ts#L3535 ). If someone wants to contribute better type definitions, that'd be awesome.

  2. vladimir-kotikov commented on Oct 19, 2016

    @vladimir-kotikov
    Contributor

    xdyang (@dev-xdyang), Bill Ticehurst (@billti), a830751 should fix the problem with autocompleting properties.

    As for 2 and 3 - the first is still a problem, even with the changes from a830751 It looks for me like a typescript issue, very similar to microsoft/TypeScript#11331

    The second one probably has nothing to do with this extension - this is how VSCode displays a hint for function parameters. Hitting Esc once works for me - the hint disappears and is not being displayed anymore.

  3. vladimir-kotikov commented on Nov 8, 2016

    @vladimir-kotikov
    Contributor

    Jimmy Thomson (@MSLaguana), this should have been resolved by #306. Can we close this?

  4. MSLaguana commented on Nov 8, 2016

    @MSLaguana
    Member

    xdyang (@dev-xdyang) We have updated the typings we use now as Vladimir Kotikov (@vladimir-kotikov) mentions, so it should be fixed. If you still have problems, feel free to re-open.

  5. josemigallas commented on Dec 5, 2018

    @josemigallas

    VSCode 1.24.1
    React Native Tools 0.7.0

    I'm still experiencing this error, only the values are shown:
    screen shot 2018-12-05 at 18 00 22
    screen shot 2018-12-05 at 17 59 59
    screen shot 2018-12-05 at 17 59 51

  6. ruslan-bikkinin commented on Dec 6, 2018

    @ruslan-bikkinin
    Contributor

    Hi Jose Miguel Gallas Olmedo (@josemigallas) extension isn't responsible for intelisense for React native anymore, I believe you better address this to vscode repo as now it manages typings stuff.

  7. HaloWang commented on Feb 27, 2019

    @HaloWang

    I create a function to fix this problem temporarily

    import { ViewStyle, TextStyle, ImageStyle } from 'react-native'
    
    /**
     * Quick Style
     *
     * related issue
     * @see https://github.com/Microsoft/vscode-react-native/issues/306
     * @see https://github.com/Microsoft/TypeScript/issues/29180
     * @see https://github.com/Microsoft/TypeScript/issues/28470
     *
     * Marco? `$`
     * @see https://github.com/Microsoft/TypeScript/issues/4892
     *
     * @todo `ViewStyle | TextStyle | ImageStyle` no work
     *  */
    type _QS = ViewStyle & TextStyle & ImageStyle
    
    export function $(style: _QS) {
      return style
    }

    usage

    const styles = StyleSheet.create({
      item: $({
        position: 'relative',
        overflow: 'visible',
      }),
    })

    And it works

    screen shot 2019-02-27 at 4 59 13 pm

    😂

  8. NilsBacke commented on May 9, 2019

    @NilsBacke

    Has this issue been fixed? Even with the fix from Ce Wang (@HaloWang) I still don't get intellisense suggestions after the first line.

  9. GollyJer commented on Jun 7, 2019

    @GollyJer

    Same issue here. Ended up finding this extension which helps.
    https://marketplace.visualstudio.com/items?itemName=jundat95.react-native-snippet

  10. ImAbhishekTomar commented on Mar 8, 2022

    @ImAbhishekTomar

    same issue.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions