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

crazy idea: enhance onhover for function #34

Open
asukaminato0721 opened this issue Jun 25, 2024 · 4 comments
Open

crazy idea: enhance onhover for function #34

asukaminato0721 opened this issue Jun 25, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@asukaminato0721
Copy link
Contributor

when coding with llm, we often ask llm what's one function/one part of code's functionality.

but traditional lsp could only show comment and function signatures.

so if onhover could also query the functionality, will be useful.

pros: more info from llm.

cons: increase the cost, the ai will generate different answers each time, the respond speed, etc.

@McPatate
Copy link
Collaborator

McPatate commented Jun 26, 2024

I like the idea!

cons: increase the cost, the ai will generate different answers each time, the respond speed, etc.

We could cache the responses to make it fast on second hover & keep the result consistent. We could provide a "clear cache" code action in the lsp to clear the generated text if it is unsatisfactory, either global or based on the cursor position to clear the llm-generated content. Could be regenerate rather than clear cache as well (the code action).

@SilasMarvin this would play well with what is stored in the memory backend & could add context to the function by fetching from the vector store.

@SilasMarvin SilasMarvin added the enhancement New feature or request label Jun 26, 2024
@asukaminato0721
Copy link
Contributor Author

asukaminato0721 commented Jun 26, 2024

some other ideas:

hover action add test case for functions.

hover action refactor functions.

@SilasMarvin
Copy link
Owner

I like the idea!

cons: increase the cost, the ai will generate different answers each time, the respond speed, etc.

We could cache the responses to make it fast on second hover & keep the result consistent. We could provide a "clear cache" code action in the lsp to clear the generated text if it is unsatisfactory, either global or based on the cursor position to clear the llm-generated content. Could be regenerate rather than clear cache as well (the code action).

@SilasMarvin this would play well with what is stored in the memory backend & could add context to the function by fetching from the vector store.

Providing documentation is a really cool idea. I don't know how this plays with other language servers. If they have a language server that already provides documentation will the editor pull from both? If I understand correctly we would need to support the textDocument/hover capability unless we want to provide this as a custom function?

@SilasMarvin
Copy link
Owner

some other ideas:

hover action add test case for functions.

hover action refactor functions.

Code actions could be incredibly cool! I really love this. Its not the top priority on my list, but I will start looking into it. We should come up with a list of codeactions we want to provide, or we should come up with a way for users to be able to configure their own?

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

No branches or pull requests

3 participants