ant-design / ant-design-pro

👨🏻‍💻👩🏻‍💻 Use Ant Design like a Pro!
https://pro.ant.design
MIT License
36.49k stars 8.14k forks source link

🐛 [BUG]使用@ant-design/pro-components中的组件时vscode不会自动补组件全导入提示? #10981

Closed LuckLin520 closed 11 months ago

LuckLin520 commented 1 year ago

🐛 bug 描述

我使用的是master的代码,使用@ant-design/pro-components中的组件时vscode不会自动补组件全导入提示?

📷 复现步骤 | Recurrence steps

image

🏞 期望结果 | Expected results

可以像使用antd组件那样输入前几个字母即可自动提示选择@ant-design/pro-components组件导入

💻 复现代码 | Recurrence code

© 版本信息

🚑 其他信息

chenshuai2144 commented 1 year ago

TAutomatically replying with ChatGPT can be attempted, but it cannot be guaranteed to be completely accurate and may not fully address all issues. Please feel free to reply if you have any further questions or concerns. 此回复基于 ChatGPT 自动生成,可以尝试下方案,官方人员会在一定时间后继续继续处理。

Hi there!

Thank you for reaching out. I understand that you are facing an issue where VSCode is not providing auto-import suggestions for the components in @ant-design/pro-components.

This issue might occur due to various reasons, but let's try a few steps to fix it:

  1. Make sure you have installed the required dependencies correctly. Run the following command to install the necessary dependencies:

    npm install @ant-design/pro-components --save
  2. Make sure you have the necessary VSCode extensions installed. You can install the following extensions to enhance TypeScript type checking and auto-completion:

    • ESLint
    • Prettier - Code formatter
    • TypeScript Import Sorter
  3. Try restarting VSCode after installing the dependencies and extensions mentioned above.

If the issue still persists, you can try the following additional steps:

  1. Open your workspace settings by clicking on File -> Preferences -> Settings (or by pressing Ctrl + ,).
  2. Search for "Import Cost" in the search bar and make sure the "Import Cost" extension is enabled. This extension provides information about the file size of imported packages and can help with auto-imports.
  3. Restart VSCode after enabling the "Import Cost" extension.

If the issue still persists after trying all these steps, it could be a specific issue with the @ant-design/pro-components library. In that case, I would recommend checking their official documentation or opening an issue in their GitHub repository for further assistance.

Please let me know if you have any other questions or concerns.