You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Control click vi.fn() to jump to vitest lib (node_modules\vitest\dist\index.d.ts)
Inspect the return type Mock<TArgs, R>
The type highlight is correct in non-takeover mode as shown below. The "show definition" in right click menu (or F12) is working.
Disable the built-in TS server and reload window to enter takeover mode.
Now the Mock<TArgs, R> shows no type highlight (though it showed "loading..." and then quickly disappears). The "show definition" does not work as shown below.
Note
Other node_modules libs tested out not working too.
no tsconfig is not affecting this bug. Include unit.spec.ts into nearest tsconfig.json does not help.
Fix the MaybeMocked type in unit.spec.ts does not help. The correct fix for its type is MockedObject fyi.
Environment
Volar 0.39.1
VSCode 1.69.2
Windows 11
The text was updated successfully, but these errors were encountered:
I'm using WSL, and was having issues with both Volar (takeover mode) and Vetur (Volar disabled) picking up my tsconfig for resolving absolute paths in .vue files. I then noticed—
I figured there were some issues with resolving paths due to VSCode running locally on Windows while the code exists in WSL land—so I was hopeful about this resolving the issue. It however, did not.
I then read about the No tsconfig message that I was getting at the bottom of VSCode, and how this can occur in the event of version mismatches[1]. And this was when I realized that the issue may now be due to the fact that I'm using Nuxt with Nuxt specific typescript support.
I couldn't figure out how to get Volar to work with this. I did try setting typescript.tsdk, but I figured it wouldn't work seeing as how I'm using takeover mode, so Volar itself is handling all the typescript stuff (?).
All my issues were resolved once I switched back to Vetur and reenabled built in TypeScript and Javascript Language Features after installing Remote Development extension pack and reopening my project from WSL (code .)
I'm not sure why it works with Vetur and not Volar. Maybe Volar is making more assumptions about the typescript sdk than Vetur is? Not sure. In any case, I hope this somewhat helps you guys (@johnsoncodehk) figure out these issues with Volar in Windows!
Step to reproduce
git clone https://github.com/cawa-93/vite-electron-builder.git
cd vite-electron-builder
git checkout 1daa1d55c69423ba515045c1f4763c462a0914fd
npm i
.\packages\main\tests\unit.spec.ts
vi.fn()
to jump tovitest
lib (node_modules\vitest\dist\index.d.ts
)Mock<TArgs, R>
Mock<TArgs, R>
shows no type highlight (though it showed "loading..." and then quickly disappears). The "show definition" does not work as shown below.Note
node_modules
libs tested out not working too.no tsconfig
is not affecting this bug. Includeunit.spec.ts
into nearesttsconfig.json
does not help.MaybeMocked
type inunit.spec.ts
does not help. The correct fix for its type isMockedObject
fyi.Environment
The text was updated successfully, but these errors were encountered: