David-Kunz / gen.nvim

Neovim plugin to generate text using LLMs with customizable prompts
The Unlicense
1.15k stars 92 forks source link

Fix code with help of LSP #19

Closed pratikgajjar closed 10 months ago

pratikgajjar commented 11 months ago

Thank you for building this plugin and sharing with the community.

Prompt : Write code in golang to send email with attachment. handle content type automatically.

Improvement:

image
David-Kunz commented 11 months ago

Hi @pratikgajjar ,

That's an interesting idea! After obtaining the list of all LSP errors/warnings, one could either annotate the provided text or shift the respective lines (which are relative to the whole document).

In any way, I'd need to see if the current models are capable of making use of such annotations.

Thank you again and best regards, David

pratikgajjar commented 11 months ago

Hi @David-Kunz Appreciate your response. One more possibility is that LSP itself become LLM aware and pass error data to LLM for suggested fix. Like how we can sort import and fix minor errors by LSP they can do the same. Here benefit would be that no one needs to make their Code Editor smart and improvements done over LSP gets benefited by everyone.

As most LSP index the codebase they can convert this into vectors and provide full context of codebase for LLM to suggest the fix.

Shall I close this issue as it's not really an issue ?

David-Kunz commented 10 months ago

Hi @pratikgajjar ,

Yes, I'd say we close this issue. First, I'll try to make this plugin as simple and lean as possible, without too much code.

Thank you and best regards, David