element-plus / element-plus

🎉 A Vue.js 3 UI Library made by Element team
https://element-plus.org
MIT License
24.39k stars 16.33k forks source link

[TypeScript] [All] Component PascalCase naming convention not working or not recognized in WebStorm. 组件大写驼峰提示在webstorm内不生效 #16259

Closed DEAN-Cherry closed 6 months ago

DEAN-Cherry commented 6 months ago

Bug Type: TypeScript

Environment

Reproduction

Related Component

Reproduction Link

Github Repo

Steps to reproduce

使用上述链接提供的仓库,装好依赖后随便在某一个文件下输入El,只会提示src/components.d.ts内声明的组件类型,当然web-type.json的小写横线组件提示是正常的,组件指向路径也是正常的。我将element-plus/global.ts内的内容全部复制到src目录下就可以正常获得所有组件的提示,似乎是webstorm识别不了element-plus/gobal.ts。隔壁arco-design-vue是把声明文件放到es目录下就正常了,这个问题很神奇,我是webstorm最新版本

What is Expected?

Get Component hints by Pascal Cases 正常获得所有组件的大写驼峰组件提示

316986939-71d8a510-a46b-43bc-b42f-75793a66227e

What is actually happening?

Only works in camel cases 只能获取到src/components.d.ts内声明的组件,放src外还不行

图片

Additional comments

Related Issue

https://github.com/element-plus/element-plus/issues/13117

btea commented 6 months ago

Maybe you could use the Volar extension.

DEAN-Cherry commented 6 months ago

Maybe you could use the Volar extension.

Thanks for your reply, but I am using WebStorm and as far as I know it is VSCode that uses Volar extension Dose it means it only works in VSCode

图片

btea commented 6 months ago

There is currently no Webstorm in my local area, but Webstorm should support Volar. refer to https://blog.jetbrains.com/webstorm/2023/05/webstorm-2023-2-eap2/#volar_support_for_vue

DEAN-Cherry commented 6 months ago

There is currently no Webstorm in my local area, but Webstorm should support Volar. refer to https://blog.jetbrains.com/webstorm/2023/05/webstorm-2023-2-eap2/#volar_support_for_vue

I managed to use Volar or Vue Language Server in WebStorm but still cannot get hints in PascalCase :(. image

btea commented 6 months ago

@kooriookami Can you help verify this issue?

kooriookami commented 6 months ago

image I can see all the components.

DEAN-Cherry commented 6 months ago

image I can see all the components.

Wow, are u using this template https://github.com/element-plus/element-plus-vite-starter?

kooriookami commented 6 months ago

Nope, I just install a vite project. Nothing else~

DEAN-Cherry commented 6 months ago

Nope, I just install a vite project. Nothing else~

Thanks, I will try later to find out what causes the difference.

github-actions[bot] commented 5 months ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

此 issue 已被自动锁定,因为关闭后没有任何近期活动。如果有相关 bug,请重新创建一个新 issue。