randomphrase / company-c-headers

Auto-completion for C/C++ headers using Company
GNU General Public License v2.0
76 stars 9 forks source link

Bad interaction with smartparens #27

Open eklitzke opened 3 years ago

eklitzke commented 3 years ago

I am using smartparens, and one of the things smartparens does (which I generally) like is that after typing an opening " character a closing " is automatically added for me after the point. Suppose I'm in a C or C++ source file and I type #include "absl/container/flat_. The current point will be set to just after the _ character but just before the closing " character that smartparens added. The company auto completions will now be flat_hash_map.h" and flat_hash_set.h". If I hit enter to finish the completion company will helpfully insert the closing " character for me which conflicts with the one provided by smartparens. I have a video demonstrating the issue here (you can skip to about 0:20 to see the issue): https://asciinema.org/a/qIaBt8o31OgqBFyBzzonx2QIH

Is it possible to detect if the point is currently within a quoted form, and then not suggest completions with a redundant closing quote? I'm honestly not sure if this is an issue with company-c-headers or company itself. I'm far from an expert in elisp but I could try to figure this out myself with some guidance on what to look for to try to fix this.