vuejs / vetur

Vue tooling for VS Code.
https://vuejs.github.io/vetur/
MIT License
5.75k stars 593 forks source link

My vetur lost its intellisense for global variables and methods #2644

Closed snoopy83101 closed 3 years ago

snoopy83101 commented 3 years ago

My vetur lost its intellisense for global variables and methods

Info

Problem

WX20210122-212653 WX20210122-212609

vetur lost its intellisense for global variables and methods

Reproducible Case

yoyo930021 commented 3 years ago

If you have package.json or jsconfig.json/TS config.json in opened project root?

snoopy83101 commented 3 years ago

If you have package.json or jsconfig.json/TS config.json in opened project root?

@yoyo930021
Originally I had package.json. After seeing your answer, I created an empty jsconfig.json

image ”Initializing JS/TS language function“

Originally I had package.json.

It's like this now, I don't understand why, the problem still exists.

snoopy83101 commented 3 years ago

I use Nuxt Is it necessary to install vue separately in package.json?

{ "name": "ry001-sys", "version": "1.0.0", "description": "My great Nuxt.js project", "author": "王力", "private": true, "scripts": { "dev": "cross-env NODE_ENV=development nodemon server/index.js --watch server --max-old-space-size=8192 ", "build": "nuxt build", "start": "cross-env NODE_ENV=production node server/index.js", "generate": "nuxt generate" }, "dependencies": { "@nuxtjs/axios": "^5.0.0", "babel-plugin-jsx-v-model": "^2.0.3", "babel-plugin-transform-vue-jsx": "^3.7.0", "clipboard": "^2.0.6", "clone": "^2.1.2", "cookieparser": "^0.1.0", "cross-env": "^5.2.0", "element-ui": "^2.4.11", "fibers": "^5.0.0", "font-awesome": "^4.7.0", "images-batch-save": "^1.0.2", "js-cookie": "^2.2.0", "js-file-downloader": "^1.1.6", "koa": "^2.5.2", "moment": "^2.23.0", "moment-range": "^4.0.2", "number-precision": "^1.3.2", "nuxt": "^2.10.1", "nzh": "^1.0.4", "qrcode": "^1.3.3", "qs": "^6.6.0", "url": "^0.11.0", "uuid": "^3.4.0", "validator": "^10.10.0", "vue-clipboard2": "^0.3.1", "vue-froala-wysiwyg": "2.9.1", "xlsx": "^0.15.0" }, "devDependencies": { "@babel/plugin-proposal-optional-chaining": "^7.9.0", "@babel/runtime-corejs2": "^7.4.4", "@nuxtjs/vuetify": "^1.9.0", "babel-core": "^6.26.3", "babel-polyfill": "^6.26.0", "nodemon": "^1.11.0" }, "bit": { "env": {}, "componentsDefaultDirectory": "components/{name}", "packageManager": "npm" } }

snoopy83101 commented 3 years ago

npm install vue@2.6.10 -s No longer prompt "Initializing JS/TS language function" But the original problem still exists.

yoyo930021 commented 3 years ago

Please provide a repro case. Please read https://github.com/vuejs/vetur/blob/master/.github/NO_REPRO_CASE.md

snoopy83101 commented 3 years ago

image

i I cloned veturpack

Only a function test11111 was added to Test.vue in methods.

But in the click event of the div, perceptual input cannot be performed. Under normal circumstances, can vetur intelligently perceive function names in methods?

I think this problem should be related to my local VSCODE configuration?

snoopy83101 commented 3 years ago

@yoyo930021

QQ20210123-130710-HD

Is it true that vetur doesn't support such intellisense?

yoyo930021 commented 3 years ago

If you open vetur.experimental.templateInterpolationService?

https://vuejs.github.io/vetur/guide/interpolation.html#generic-language-features

snoopy83101 commented 3 years ago

@yoyo930021 Yes, I turned on this configuration When I deleted watchQuery and asyncData, it worked!

But watchQuery and asyncData are important parts of NUXT! Is there any way I can make vuetur work without deleting them?

QQ20210123-134402-HD

yoyo930021 commented 3 years ago

If you set this settings in tsconfgi.json/tsconfig.json ? https://typescript.nuxtjs.org/zh-Hant/guide/setup#%E8%A8%AD%E5%AE%9A

snoopy83101 commented 3 years ago

@yoyo930021

tsconfgi.json/tsconfig.json ? meaning is jsconfig.json / tsconfig.json ?

My project does not use ts for the time being, how should I configure it?

yoyo930021 commented 3 years ago

Only need to rename to jsconfig.json

https://typescript.nuxtjs.org/guide/setup/#configuration

snoopy83101 commented 3 years ago

@yoyo930021 I configured this way, the problem still exists, but I wonder if the problem is not in jssconfig.json.

When ”layout, watchQuery and asyncData“ exist (they are all part of NUXT)