简体   繁体   English

没有在 Visual Studio Code for React Native 中获取 IntelliSense

[英]Not getting IntelliSense in Visual Studio Code for React Native

I am trying to code a React Native application in Visual Studio Code.我正在尝试在 Visual Studio Code 中编写 React Native 应用程序。 But I found that the hint for React Native for Styles element didn't show when I code.但是我发现当我编码时没有显示 Styles 元素的 React Native 提示。 I already installed:我已经安装了:

 ES7+ React/Redux/React-Native snippets
 React Native Tools
 Simple React Snippets

Here is the example when I type flex.这是我键入 flex 时的示例。 It is supposed to show a list of styles element related to flex but it didn't.它应该显示与 flex 相关的 styles 元素的列表,但它没有。 Is anyone know how to enable it?有人知道如何启用它吗? Here is a screenshot:这是一个截图:

在此处输入图像描述

Here is my settings.json file这是我的 settings.json 文件

{
    "java.home": "C:\\Program Files\\Java\\jdk1.8.0_211",
    "java.help.firstView": "gettingStarted",
    "editor.suggestSelection": "first",
    "vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
    "python.languageServer": "Default",
    "workbench.editorAssociations": {
        "*.ipynb": "jupyter-notebook"
    },
    "notebook.cellToolbarLocation": {
        "default": "right",
        "jupyter-notebook": "left"
    },
    "php.suggest.basic": false,
    "php.validate.enable": false,
    "emmet.excludeLanguages": [
        "markdown",
        "php"
    ],
    "php.validate.executablePath": "C:/xampp/php/php.exe",
    "php.debug.executablePath": "C:/xampp/php/php.exe",
    "php.executablePath": "C:/xampp/php/php.exe",
    "vs-color-picker.autoLaunch": true,
    "liveServer.settings.CustomBrowser": "chrome",
    "liveServer.settings.useLocalIp": true,
    "liveServer.settings.port": 0,
    "workbench.colorTheme": "Visual Studio Dark",
    "git.confirmSync": false,
    "[javascript]": {
        "editor.defaultFormatter": "esbenp.prettier-vscode"
    },
    "workbench.iconTheme": "material-icon-theme",
    "editor.formatOnPaste": true,
    "editor.formatOnType": true,
    "editor.formatOnSave": true,
    "[vue]": {
        "editor.defaultFormatter": "esbenp.prettier-vscode"
    },
    "[javascriptreact]": {
        "editor.defaultFormatter": "esbenp.prettier-vscode",
    },
    "emmet.includeLanguages": {
        "javascript": "javascriptreact",
        "typescript": "typescriptreact",
    },
}

I solved this problem by following this post:我按照这篇文章解决了这个问题:

VsCode Intellisense react native not working VsCode Intellisense 反应本机不工作

Which is installing this npm package into your project.正在将此 npm package 安装到您的项目中。 By entering this command inside the terminal window of your VS Code:通过在 VS Code 的终端 window 中输入此命令:

npm install --save @types/react-native

Thanks for the help!谢谢您的帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM