[英]Intellisense not working with imports in Visual Studio Code
When using javascript (es2015) imports the Intellisense seems to be broken. 使用javascript(es2015)导入时,Intellisense似乎已损坏。
When I am working in the same file, VSC autosuggests the methods from the object with the correct JSDoc information. 当我在同一文件中工作时,VSC会使用正确的JSDoc信息自动建议对象中的方法。
However, when importing the Class in another file, the Intellisense seems to be completely broken ( david.david, wtf? ). 但是,将Class导入另一个文件时,Intellisense似乎已完全损坏(david.david,wtf?)。
Do I need to adjust any settings in Visual Studio Code to get this working? 我是否需要在Visual Studio Code中调整任何设置才能使其正常工作? I tried adjusted my jsconfig file to es2015 imports and es6 as but that didn't work.
我尝试将jsconfig文件调整为es2015 import和es6,但这没有用。
My jsconfig.json: 我的jsconfig.json:
{
"compilerOptions": {
"module": "es6"
}
}
Because you are using export
without default
you need to enable allowSyntheticDefaultImports
由于您使用的是无
default
export
,因此需要启用allowSyntheticDefaultImports
{
"compilerOptions": {
"target": "es6",
"allowSyntheticDefaultImports": true
}
}
The same occurs with 同样发生
import fs from 'fs';
import axios from 'axios';
And others. 和别的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.