microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.95k stars 29.53k forks source link

JSDoc intellisense not working if package.json is nested #51373

Closed rheaditi closed 6 years ago

rheaditi commented 6 years ago

Issue Type: Bug

Hey guys! 👋

I have several projects that I work with. I've noticed that jsdoc intellisense does not seem to be working in those projects where the package.json file is nested within a sub-folder. Opening the sub-folder directly in VSCode loads the jsdoc helpers however.

Is there a configuration that I need to set up to get jsdoc intellisense working for these scenarios.

Thanks! 😄

VS Code version: Code 1.24.0 (6a6e02cef0f2122ee1469765b704faf5d0e0d859, 2018-06-06T17:30:30.113Z) OS version: Darwin x64 17.5.0

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz (4 x 2700)| |GPU Status|2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: enabled
rasterization: enabled
video_decode: enabled
video_encode: enabled
vpx_decode: enabled
webgl: enabled
webgl2: enabled| |Load (avg)|2, 2, 2| |Memory (System)|8.00GB (0.02GB free)| |Process Argv|/Applications/Visual Studio Code.app/Contents/MacOS/Electron .| |Screen Reader|no| |VM|0%|
Extensions (42) Extension|Author (truncated)|Version ---|---|--- vscode-markdownlint|Dav|0.18.0 EditorConfig|Edi|0.12.4 gc-excelviewer|Gra|2.0.21 output-colorizer|IBM|0.1.2 vscode-jest|Ort|2.8.0 ejs-language-support|Qas|0.0.1 vscode-paste-and-indent|Rub|0.0.8 indenticator|Sir|0.6.0 jsx|Twe|0.0.1 quokka-vscode|Wal|1.0.130 html-css-class-completion|Zig|1.17.1 vscode-css-formatter|aes|1.0.1 vscode-color|ans|0.4.5 solargraph|cas|0.17.4 npm-intellisense|chr|1.3.0 path-intellisense|chr|1.4.2 vscode-eslint|dba|1.4.12 gitlens|eam|8.3.4 tslint|eg2|1.0.30 vscode-npm-script|eg2|0.3.4 vscode-great-icons|emm|2.1.33 prettier-vscode|esb|1.5.0 auto-close-tag|for|0.5.6 auto-rename-tag|for|0.0.15 node-module-intellisense|lei|1.5.0 ruby-rubocop|mis|0.7.0 ecdc|mit|0.12.0 vscode-scss|mrm|0.6.2 python|ms-|2018.5.0 atom-keybindings|ms-|3.0.4 debugger-for-chrome|msj|4.5.0 color-highlight|nau|2.3.0 language-liquid|nei|0.0.3 seti-icons|qin|0.1.3 Ruby|reb|0.18.0 postcss|ric|2.0.0 partial-diff|ryu|1.1.0 stylelint|shi|0.36.3 gitblame|wad|2.4.2 vscode-todo-highlight|way|0.5.12 vscode-import-cost|wix|2.7.1 better-align|wwm|1.1.6 (4 theme extensions excluded)
mjbvz commented 6 years ago

Please provide a small project that demonstrates this issue

rheaditi commented 6 years ago

@mjbvz I'm unable to reproduce this problem in a fresh project. I suspect we have some obscure configuration in our projects which are creating conflicts/issues.

Since it's a closed source project, I might not be able to share the exact configuration.

Our structure is somewhat like this:

.
├── Jenkinsfile
├── README.md
├── ops
│   └── ...
└── src
    ├── app.js
    ├── bin
    ├── config
    ├── node_modules
    ├── package-lock.json
    ├── package.json
    ├── public
    ├── routes
    ├── tests
    ├── utils
    ├── views
    └── webpack.config.js

When I open the root directory above, intellisense for require()s or identifiers doesn't work for files such as app.js. However if I open the src directory directly in vscode, it seems to work..

If you could point me towards what could be possible problems or how to debug the intellisense, it would help a lot!

mjbvz commented 6 years ago

At the root of src, try creating a jsconfig.json with the content:

{
    "compilerOptions": {
        "target": "ES6"
    },
    "exclude": [
        "node_modules",
        "**/node_modules/*"
    ]
}

Does this resolve the problem? You can also try moving the jsconfig up to the root of the project if having it in src does not work

vscodebot[bot] commented 6 years ago

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!