admin管理员组文章数量:1026989
I am working with javascript. Usual cases the imports would look like:
import reducerUtils from '../../utils/reducerUtils'
And the peek definition
or go to definition
on reducerUtils
works as expected.
Things goes different when I change the import to:
import reducerUtils from 'projectname/src/utils/reducerUtils'
The path is definitely valid and the app works too but in the editor the peek definition
or go to definition
does not work anymore
I understand this could be a standard issue looking from the editors perspective but I was just looking for any solution here to make it work. It might involve into some configuration changes somewhere but my search had no luck. Help Would be appreciated.
I am working with javascript. Usual cases the imports would look like:
import reducerUtils from '../../utils/reducerUtils'
And the peek definition
or go to definition
on reducerUtils
works as expected.
Things goes different when I change the import to:
import reducerUtils from 'projectname/src/utils/reducerUtils'
The path is definitely valid and the app works too but in the editor the peek definition
or go to definition
does not work anymore
I understand this could be a standard issue looking from the editors perspective but I was just looking for any solution here to make it work. It might involve into some configuration changes somewhere but my search had no luck. Help Would be appreciated.
Share Improve this question edited Dec 26, 2018 at 19:21 Gama11 34.3k9 gold badges90 silver badges106 bronze badges asked Oct 26, 2018 at 9:17 ShocKwav3_ShocKwav3_ 1,7606 gold badges24 silver badges44 bronze badges1 Answer
Reset to default 4Adding a jsconfig.json
file at the root(or wherever appropriate depending on the project). Specify the paths
under pilerOptions
. eg,
{
"pilerOptions": {
"baseUrl": "./",
"paths": {
"projectname/*": ["./*"], //it's root in my case
}
},
"exclude": ["node_modules"]
}
Bit more closer look: https://medium./@justintulk/solve-module-import-aliasing-for-webpack-jest-and-vscode-74007ce4adc9
Official Doc: https://code.visualstudio./docs/languages/jsconfig
I am working with javascript. Usual cases the imports would look like:
import reducerUtils from '../../utils/reducerUtils'
And the peek definition
or go to definition
on reducerUtils
works as expected.
Things goes different when I change the import to:
import reducerUtils from 'projectname/src/utils/reducerUtils'
The path is definitely valid and the app works too but in the editor the peek definition
or go to definition
does not work anymore
I understand this could be a standard issue looking from the editors perspective but I was just looking for any solution here to make it work. It might involve into some configuration changes somewhere but my search had no luck. Help Would be appreciated.
I am working with javascript. Usual cases the imports would look like:
import reducerUtils from '../../utils/reducerUtils'
And the peek definition
or go to definition
on reducerUtils
works as expected.
Things goes different when I change the import to:
import reducerUtils from 'projectname/src/utils/reducerUtils'
The path is definitely valid and the app works too but in the editor the peek definition
or go to definition
does not work anymore
I understand this could be a standard issue looking from the editors perspective but I was just looking for any solution here to make it work. It might involve into some configuration changes somewhere but my search had no luck. Help Would be appreciated.
Share Improve this question edited Dec 26, 2018 at 19:21 Gama11 34.3k9 gold badges90 silver badges106 bronze badges asked Oct 26, 2018 at 9:17 ShocKwav3_ShocKwav3_ 1,7606 gold badges24 silver badges44 bronze badges1 Answer
Reset to default 4Adding a jsconfig.json
file at the root(or wherever appropriate depending on the project). Specify the paths
under pilerOptions
. eg,
{
"pilerOptions": {
"baseUrl": "./",
"paths": {
"projectname/*": ["./*"], //it's root in my case
}
},
"exclude": ["node_modules"]
}
Bit more closer look: https://medium./@justintulk/solve-module-import-aliasing-for-webpack-jest-and-vscode-74007ce4adc9
Official Doc: https://code.visualstudio./docs/languages/jsconfig
本文标签:
版权声明:本文标题:javascript - Visual Studio Code peekgo to definition not working when imports are specified with project name - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745663980a2162064.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论