Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/visual-studio-code/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Visual studio code VSCode intellisense已停止使用js模块导入_Visual Studio Code - Fatal编程技术网

Visual studio code VSCode intellisense已停止使用js模块导入

Visual studio code VSCode intellisense已停止使用js模块导入,visual-studio-code,Visual Studio Code,当使用javascript(es2015)导入时,Intellisense拒绝工作 例如:从'react router dom'导入{} 在import语句的大括号内点击[CTRL]+[SPACE],没有任何建议的迹象,列出了模块的导出实体 当我尝试导入使用导出默认值导出的内容时,也没有任何建议 myjsconfig.json { "compilerOptions": { "target": "es6", "allowSyntheticDefaultImports": tru

当使用javascript(es2015)导入时,Intellisense拒绝工作

例如:
从'react router dom'导入{}
import
语句的大括号内点击[CTRL]+[SPACE],没有任何建议的迹象,列出了模块的导出实体

当我尝试导入使用
导出默认值导出的内容时,也没有任何建议

my
jsconfig.json

{
  "compilerOptions": {
    "target": "es6",
    "allowSyntheticDefaultImports": true
  },
  "exclude": [
    "node_modules",
    "**/node_modules/*"
  ],
  "include": [
    "src/**/*"
  ]
}
我正在使用
“allowSyntheticDefaultImports”:true
,以便在没有默认值的情况下处理导出。 我过度使用
排除
部分,我知道)

VSCODE关于

Version: 1.31.1
Commit: 1b8e8302e405050205e69b59abb3559592bb9e60
Date: 2019-02-12T02:19:29.629Z
Electron: 3.1.2
Chrome: 66.0.3359.181
Node.js: 10.2.0
V8: 6.6.346.32
OS: Linux x64 4.15.0-45-generic

除此之外,一切和intellisense都能正常工作

有两个选项对我很有用:

  • 对象的“构建操作”设置为“无”。将其更改为Compile(使用.cs-tho)
  • 关闭VS,删除资源管理器中解决方案旁边隐藏的“.VS”文件夹。重新打开VS