Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

idea intention 菜单提供重命名函数,变量功能 #132

Closed
zjh7890 opened this issue Apr 2, 2024 · 12 comments
Closed

idea intention 菜单提供重命名函数,变量功能 #132

zjh7890 opened this issue Apr 2, 2024 · 12 comments

Comments

@zjh7890
Copy link

zjh7890 commented Apr 2, 2024

有时候懒得想函数名...

@zjh7890 zjh7890 changed the title 自动重命名函数,变量 idea intention 菜单提供重命名函数,变量功能 Apr 2, 2024
@phodal
Copy link
Member

phodal commented Apr 2, 2024

哈哈,是要在 Shift + F6 里加功能

@zjh7890
Copy link
Author

zjh7890 commented Apr 2, 2024

老哥有交流群吗,我也想加入 hhh

@phodal
Copy link
Member

phodal commented Apr 2, 2024

没有了,懒得建,之前有一个辅助研发的,加一下 phodal02,注明来意

@phodal
Copy link
Member

phodal commented Apr 2, 2024

想起来了,你这有点费 token

phodal added a commit that referenced this issue Apr 2, 2024
…g support by adding post-action support and code completion #132
@zjh7890
Copy link
Author

zjh7890 commented Apr 2, 2024

想起来了,你这有点费 token

哈哈,充值就完事😂

phodal added a commit that referenced this issue Apr 2, 2024
…e completion #132 #129

This commit introduces a new class, `RenameLookupManagerListener`, which enhances refactoring support by adding post-action support and code completion functionality. The listener is designed to work with `LookupImpl` and `TemplateManagerImpl` to provide a more robust refactoring experience. It includes a list of suggestions (`suggestion1`, `suggestion2`, `suggestion3`) and adds them to the lookup with a custom `RenameLookupElement` that renders with the `AutoDevIcons.Idea` icon. This change improves the usability and functionality of the refactoring process.
phodal added a commit that referenced this issue Apr 2, 2024
…e completion #132

This commit introduces a new class, `RenameLookupElement`, which enhances the user interface and code completion capabilities. The refactoring includes the use of `LlmFactory` to generate better naming suggestions, and the introduction of a `RenameLookupManagerListener` to listen for changes in the active lookup. The listener now collects suggestions from a flow and adds them to the lookup, significantly improving the user experience. Additionally, the project listeners have been updated to include the `RenameLookupManagerListener`, ensuring that the refactoring is fully integrated into the project's event system.
@phodal
Copy link
Member

phodal commented Apr 2, 2024

第一个版本先这样:

图片

等 build 完应该就可以体验了:https://github.com/unit-mesh/auto-dev/actions/runs/8524783767

你先测试测试,我来加个 toggle

phodal added a commit that referenced this issue Apr 2, 2024
…meLookupElement and using ApplicationManager to invoke the stream function in a non-blocking way, resolving #132.
@phodal
Copy link
Member

phodal commented Apr 2, 2024

详细 prompt 见:

val stringFlow: Flow<String> = llm.stream(
"""$name is a badname. Please provide 5 better options name for follow code:
```${element.language.displayName}
${element.text}
```
1.
""".trimIndent(),
"",

@zjh7890
Copy link
Author

zjh7890 commented Apr 2, 2024

你这迭代效率也太给力了...

@phodal
Copy link
Member

phodal commented Apr 3, 2024

不过,有 bug ,等我关了 isue,再测试吧

@zjh7890
Copy link
Author

zjh7890 commented Apr 3, 2024

不过,有 bug ,等我关了 isue,再测试吧

ok

phodal added a commit that referenced this issue Apr 3, 2024
…meLookupElement and using ApplicationManager to invoke the stream function in a non-blocking way, resolving #132.

The refactoring includes the introduction of the `RenameLookupElement` class and the use of `ApplicationManager.getApplication().invokeLater` to run the stream function in a non-blocking manner, improving the performance and responsiveness of the rename lookup manager listener. This commit also addresses issue #132 by providing a more efficient way to collect and process the stream of strings, resulting in a cleaner and more maintainable codebase.
phodal added a commit that referenced this issue Apr 3, 2024
This commit refactors the `RenameLookupManagerListener` class by introducing a new `RenameLookupElement` class and leveraging the `ApplicationManager` to execute the stream function in a non-blocking manner. This change addresses issue #132 by improving the performance and responsiveness of the code completion feature.
phodal added a commit that referenced this issue Apr 3, 2024
…ing #132

This commit enhances the rename suggestion feature by refactoring the logic to use coroutines for better performance and adding logging for improved debugging. It also fixes an issue with the import statements to ensure the code compiles correctly.
phodal added a commit that referenced this issue Apr 3, 2024
…ing #132

This commit enhances the rename suggestion feature by introducing a more robust logic and adds logging capabilities. The changes include:

- Implementing `AutoDevStatusService` to notify the application status.
- Adding try-catch blocks to handle exceptions gracefully.
- Modifying the string flow collection and suggestion parsing logic.
- Updating the `LookupListener` to handle lookup cancellation.

These improvements ensure a smoother and more reliable rename suggestion experience, with better error handling and status updates.
phodal added a commit that referenced this issue Apr 3, 2024
This commit refactors the code to use the `TemplateManagerImpl.getTemplateState` method to update the template state, rather than manually calling `update()`. This improves the readability and maintainability of the code by leveraging the existing API.
@phodal
Copy link
Member

phodal commented Apr 3, 2024

可以体验了,https://plugins.jetbrains.com/plugin/21520-autodev/versions/snapshot

需要从配置中打开功能,

图片

@phodal phodal closed this as completed Apr 3, 2024
@zjh7890
Copy link
Author

zjh7890 commented Apr 3, 2024

可以体验了,https://plugins.jetbrains.com/plugin/21520-autodev/versions/snapshot

需要从配置中打开功能,

图片

ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants