abingham / emacs-ycmd

Emacs client for ycmd, the code completion system.
MIT License
384 stars 46 forks source link

In C , ycmd-eldoc--info-at-point always uses the cache(if exist) when the cursor is in the same function no matter which param I put the cursor at #419

Closed zijianyue closed 7 years ago

zijianyue commented 7 years ago
(let ((symbol (ycmd-eldoc--with-point-at-func-name (symbol-at-point))))
  (if (and symbol (eq symbol (aref ycmd-eldoc--cache 0)))
      (aref ycmd-eldoc--cache 1)

But the right result is that different param has different eldoc I think.

ptrv commented 7 years ago

Yes, this is by design. When your cursor is on a function between the parentheses, we show the info for the function and not for the params. ycmd-eldoc--with-point-at-func-name jumps back to the function name to get the symbol for the function.

if your cursor is at the 2: foo(1, 2|) we show the info for foo. (ycmd-eldoc--with-point-at-func-name makes the cursor jump backt to foo|(1, 2) to get information)