Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intellisense in latest Vetur is painfully slow #2163

Closed
3 tasks done
kjeksfjes opened this issue Aug 14, 2020 · 10 comments · Fixed by #2374
Closed
3 tasks done

Intellisense in latest Vetur is painfully slow #2163

kjeksfjes opened this issue Aug 14, 2020 · 10 comments · Fixed by #2374

Comments

@kjeksfjes
Copy link

  • I have searched through existing issues
  • I have read through docs
  • I have read FAQ

Info

  • Platform: macOS
  • Vetur version: 0.26.1
  • VS Code version: 1.48.0

Problem

Intellisense, e.g. when typing import whatever from './' i takes around 10 seconds for suggestion to pop up.

I've tried downgrading VS Code to no avail. The only thing that seems to work is downgrading Vetur to 0.25.0.

Reproducible Case

  • Use latest Vetur on latest VS Code. Use something like Path Intellisense (doesn't matter) and try to import something by typing import whatever from './'.
  • Expected result: Intellisense suggestion pops up right away.
  • Actual result: After 10 seconds or so intellisense suggestion pops up.
@yoyo930021
Copy link
Member

@sethidden
Copy link
Contributor

sethidden commented Aug 14, 2020

Having similar issue but with TypeScript intellisense of instance properties in <script> or <template> tags.

What I did to reproduce:

  1. Open https://github.com/tokyo-metropolitan-gov/covid19/blob/development/components/PositiveRateMixedChart.vue (in vscode after cloning repo and npm install, not on web)
  2. Go to <template>
  3. Write down v-text="displayOptionHeader." (notice dot at end) in some random tag
  4. Pressed start CPU profiling in Chrome
  5. Return to vscode after '.' and press ctrl+space
  6. Wait for intellisense box to appear with suggestions based on TS interface
  7. Stop CPU profiling

The CPU profile itself (zipped): covid-19-ctrl-space-in-template.zip Vetur 26.1, vscode 1.48.0-insider

I mainly experience it at work in a vue-property-decorator TS project but I don't wanna share the profile from there

@IWANABETHATGUY
Copy link
Contributor

Actually , most language feature of vetur come from typescript, so the bottleneck also came from typescript, i am not sure if vetur using the typescript incremental parsing.

@sethidden
Copy link
Contributor

The difference between editing a .ts file and .vue lang="ts" file in the same workspace is very noticeable. IntelliSense in .ts is much faster, though I use the TS nightly extension. Not sure if others share the same experience

@octref
Copy link
Member

octref commented Aug 26, 2020

From @3nuc's profile, seems recreateVueTempalteSourceFile is slow.
Does turning off "vetur.experimental.templateInterpolationService": false help?

@kjeksfjes If you don't provide a profile, there's nothing I can do. Your issue is likely unrelated to @3nuc's.

@IWANABETHATGUY
Copy link
Contributor

"vetur.experimental.templateInterpolationService": false
Is it possible to turn our parser into incremental?so that we don't need to reparse our .vue file every edit.
I found that here is a incremental parser generator framework tree-sitter,

@IWANABETHATGUY
Copy link
Contributor

one more, i already found one incremental vue parser generate by tree-sitter,which is available , https://github.com/ikatyang/tree-sitter-vue,
demo link

@ZhangPuXi
Copy link

Also met the same issue, it seems that it also slows the emmet suggestion.

@kingkong404
Copy link

Same issue here.

@castrix
Copy link

castrix commented Aug 14, 2021

I had the same issue, I'm using this boilerplate for my project with compositon api https://github.com/sapphi-red/vite-boilerplate-plus. on my other project I use vue class component and not experiencing any issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants