The previous behavior was aggressive,
#include "abc/f^/abc.h" foo/ -> candidate
"f/abc.h" is replaced with "foo/", this patch will preserve the "abc.h".
Differential D76770
[CodeComplete] Don't replace the rest of line in #include completion. hokein on Mar 25 2020, 6:23 AM. Authored by
Details The previous behavior was aggressive, #include "abc/f^/abc.h" foo/ -> candidate "f/abc.h" is replaced with "foo/", this patch will preserve the "abc.h".
Diff Detail
Unit Tests Event TimelineComment Actions Does this regress the case where you complete a file rather than a directory? The root here is that we have to decide what to replace independently of the completion item. Or we can take the tradeoff here if it's better but it'd be good to understand why. Comment Actions yes, it has a regression, but we don't change the behavior for the above case. A regression case is like #include "foo/^dir1/one.h" // with two candidates: dir2 and foo.h if we choose 2), after completion, "foo/foo.h/one.h" (now) vs foo/foo.h (before)
agree, it doesn't seem to be worth the effort.
it was originally reported by one internal user. I think the new behavior (with this patch)
Comment Actions Oops, right :-)
OK, let's try it and see if people complain. |