QodeAssist icon indicating copy to clipboard operation
QodeAssist copied to clipboard

feat: Merge suggestion with existing code if it looks similar

Open OneMoreGres opened this issue 7 months ago • 5 comments

Hi!

This is something like what I meant in #152 .

It doesn't affect representation. During full suggestion apply, it searches for the next rows that look similar to the applied text. If they are similar enough (this should be configurable, perhaps) it replaces the found rows with suggested.

Suggestion

Apply result

No real use in this example though :)

OneMoreGres avatar May 18 '25 18:05 OneMoreGres

Thank you, I will check how it works on my side

Palm1r avatar May 19 '25 08:05 Palm1r

Looks very nice and works great for apply() all rows. Thank you! Can we adapt this to visualize completions before inserting? Now it shows old changes. PS I definitely want to merge this, so don't forget to add your copyrights and remove the qDebug()

Palm1r avatar May 21 '25 07:05 Palm1r

Ok, I'll experiment with visualization

OneMoreGres avatar May 21 '25 19:05 OneMoreGres

Looks like QTC supports suggestions only for a single QTextBlock and doesn't allow to set multiple suggestions or even change suggestion visualization format. So I just add a comment about replacing lines count =\

OneMoreGres avatar May 25 '25 15:05 OneMoreGres

yes, I also found the capabilities of QtC in the code editor are very limited. But I thought maybe via LSP we can do it more or creating several suggestion. I will review your code and maybe suppose smth else or merge that with specific settings. Thank you!

Palm1r avatar May 26 '25 13:05 Palm1r

Sorry for delay, I checked your code and Idea, and I think it looks great and I will be back soon to add this to plugin. I need to finish something bigger, that allow us to use differents types of code suggestion and easy to setup

Palm1r avatar Jun 18 '25 18:06 Palm1r