vetur: Vetur Intellisense slow and incomplete if project has jsconfig
Info
- Platform: Win
- Vetur version: 0.11.3
- VS Code version: 1.18.0
Problem
Vetur shows incomplete Intellisense and it takes too much time. It works fine if the project is virtual (no jsconfig or tsconfig).
Reproducible Case
https://github.com/Akryum/devfest-nantes-2017/tree/vs-code/app
Open this folder in VS Code and try Vetur in a .vue
file.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 12
- Comments: 46 (19 by maintainers)
This should be fixed in 0.20.0. A small summary:
New way it works:
node_modules
are cached and frozen (since they likely won’t change).updated 2018-5-8 after more debug, I found that remove the
./src/*
ininclude
ofjsconfig.json
, can fix this problem.=======================================
for the slow problem, I try to run simple profile.
after profiling by devtool, I found that large project with
jsconfig.json
ortsconfig.json
cause thishost.getScriptFilaNames
returns a large array of filePath, and this will cause ts language service runHostCache.createEntry
huge times。the
host.getScriptFileNames
returnsthe profile
Had same issue. Regular .js files were fine, but not .vue files. Fixed it by adding “include” in jsconfig.json:
Have same issue. Intelisense works slow in
.vue
file, and works fine in.ts
. So for a better coding performance, i have to separate SFC into.vue
and.ts
.The config
include
intsconfig
is setted as below. There are almost 300 files in these directories(.vue
,.js
,.ts
).But if
node_modules
are frozen, when i usenpm link
, it seems that autocomplete cannot refresh after I made some changes to the code.in .vue file
In .ts file it is working
@octref I was able to reproduce this issue with a couple files in this repository. I managed to find two cases that neither intellisense or path suggestions works. I hope this information can help somehow.
Specs that I used to reproduce the issue
Windows 10
Version 1709
Visual Studio CodeUpdate 1.19.3
VeturVersion 0.11.7
Open folder has a subfolder with a
jsconfig.json
filesample-vetur-jsconfig\sub-folder-example
Intellisense: works on .js files only Path suggestions: works on .js files only
Open folder has a root
jsconfig.json
filesample-vetur-jsconfig\sub-folder-example\js
Intellisense: works on .js and .vue files Path suggestions: works on .js and .vue files
Open folder has a root
jsconfig.json
file with path aliasessample-vetur-jsconfig\root-folder-example
Intellisense: works on .js and .vue files Path suggestions: works on .js and .vue files. But not with alias (.js and .vue).
I’ve looked further in this case and I saw this issue in the TypeScript repository that mentions this behaviour. I believe this issue may also affect vetur suggestions. But I’m not sure if this fix is available in the stable release or not. 🤔
There is also a fourth case that vetur is not understanding the
baseUrl
value in rootjsconfig.json
if your value is a subfolder like"baseUrl": "./js",
. In this last one both Intellisense and path suggestion will work on .js files but not on .vue files.Setting
"moduleResolution": "classic"
incompilerOptions
seems to fix the slowness. However, it disablesnode_modules
intellisense on some modules.Changing
moduleResolution
incompilerOptions
fromnode
toclassic
on the slow project seems to fix the slowness, even if I don’t understand why it runs without problem like that on the fast project. If that can help anyone.Any update on the incomplete IntelliSense issue?
me too, finally, I find it work slow with jsconfig.json. It work bad on my old note computer with third generations i5 , and work very fastly on my new computer with i7 8700. but in js (not vue ), all they work very fast. I think Vetur has High cpu usage with jsconfig.json / tsconfig.json. #913
Same slowness here on my notebook. (about 3 secs)
Both path suggestion and intellisense work but are slow. (
paths
alias in jsconfig.json also works.)System info
Specs
Here’s my
jsconfig.json
.After I rename it to
jsconfig2.json
(the same effect as removing it from the project), the slowness is fixed. Adding or removinginclude
has no effect to fix the slowness. (After each change, VSC was restarted)But with the same jsconfig.json, I cannot reproduce the slowness in a minimal project yet. (I should look into what the differences are between the minimal project and my current one)
@octref Did you have time to check the reproduction on Windows to see if you have the issue?
I do have a Windows machine at home. I can try it later today.
I’ll take a look at the incomplete IntelliSense.