Open zcf0508 opened 8 months ago
So far, I have noticed two major issues.
vue
file, you are necessary to open ajs
or ts
file to start the vscode TS language service so that the types in the vue
file can be obtained normally.js
or ts
file like 1.AFAIK Volar 2.0 is released recently. The API may be changed a lot. I'm not sure how should this PR be done.
@sxzz I saw the update for volar
, but no new version of vue-tsc
based on volar
2.0 has been released yet.
It seems that it should not be a very difficult thing to do, I will follow up later on.
I'm waiting for that vue-tsc
releases the update with volar.js
2.0 and volar.js
exposes FileRegistry
by merging https://github.com/volarjs/volar.js/pull/128 or other ways.
As vue-lanugage-tools
updated 2.0, there is a build of this extension available for everyone to try.
typescript-explorer-0.4.2-vue-ts5.zip
@sxzz @johnsoncodehk
Update Volar to v2.2.0-alpha.12
, thanks for @johnsoncodehk .
@zcf0508 I can't build this branch successfully locally, can I get some guidance?
@johnsoncodehk Right, this branch only add vue support but it can't build locally. You can checkout to https://github.com/zcf0508/ts-type-explorer/tree/feat/vue%2Bts5 this branch.
yarn
cd package/api
yarn build
cd ..
cd typescript-pblugin
npx tsc -d
cd ..
cd typescript-explorer-vscode
yarn package
Since vue.volar
inject the language
to program (https://github.com/vuejs/language-tools/pull/3963), now if you install the vue.volar
extension above 2.0.16, the extension can get type information from volar extension and recreating a vue language program is unnecessary. Thanks for @johnsoncodehk !
volar 扩展已经废弃,目前使用Vue - Official
volar 扩展已经废弃,目前使用Vue - Official
@xzhdev 只是改了名字而已,扩展的标识还是 vue.volar
@zcf0508 好的哥,但是我用了你的vsix后,vue中ts类型显示error
Fixed location error, now goToDefinition
works fine. And https://github.com/mxsdev/ts-type-explorer/pull/45#issuecomment-2102037309 this issue has been resolved.
I create a new typescript program by
vue-tsc
and then get the type from virtual file.I tried to get the type from
volar
but I have no idea about howvolar
resolve the type. It seems that only provide the information of type bygetTypeDefinitionAtPosition
orgetDefinitionAtPosition
function tovscode
. I don't know.I think this is an important feature to debug type with
vue
file. Could @sxzz and @johnsoncodehk review the code together?https://github.com/dsherret/ts-morph/issues/1310