lebr0nli/GEP

Problem with completion popup text

fikovnik opened this issue · 5 comments

I was trying out this plugin (really cool btw) and I think there is a problem with the completion:

For example:

GEP

The rho)) prefix is off.

Hi, thanks for reporting the bug!

I think I know where's going wrong after some testing, I'll try to fix it!

Edit:
I think the cause of the problem is that I try to complete the command for the "full" text in the buffer. I think the correct implementation is complete the command based on the text before the cursor.

By the way, is it possible to provide the steps to reproduce it or the binary file you debugging on?

Thanks!

The binary is the R interpreter, once installed / compiled with debugging symbols, you can run it with debugger attached:

R -d gdb

put a breakpoint somwehere, e.g. Rf_eval function and run the program:

b Rf_eval
r

then you can try the following:
GEP2

the prefix R_inspect should not be part of the completion.

Or trigger the suffix:

GEP3

After some testing, I think there are two problems:

  1. Autocompletion should base on the text before the cursor, not based on the full text in the input buffer

  2. \W+ ( [^a-zA-Z0-9_]+ ) should be used to split the display text in the popup instead of using spaces, which means:

then you can try the following: GEP2

The text in the popup should be changed to:

Rf_lang1
Rf_lang2
Rf_lang3
Rf_lang4
Rf_lang5
Rf_lang6
Rf_lastElt

Hi @fikovnik , thanks for the details you provided, these details are really helpful!

For some reason, I can't build the R interpreter with debug info successfully now. Can you help me to check if the bug is still there after this update? Is the new logic of autocompletion make sense?

Thanks!

Perfect! It fixes the issue.