ikirill / irony-eldoc

irony-mode support for eldoc-mode
30 stars 9 forks source link

Shows no docs for `printf("string");`, does show docs for `puts("string") #1

Closed ackalker closed 7 years ago

ackalker commented 9 years ago

I'm using Emacs 24.4, with irony, company-mode, company-irony and irony-eldoc from MELPA, all set up as documented in their READMEs.

In the canonical "Hello, world" example:

#include <stdio.h>
#include <stdlib.h>

int main(void) {
  printf("Hello, world!\n");
  return 0;
}

when I place point on or within the printf, I don't get any documentation in the echo area. When I change printf to puts, I do get the documentation for puts, but only if i move point within the symbol puts, not when inside the string (as I gather I should from browsing the code).

When I define a trivial function foo:

#include <stdio.h>
#include <stdlib.h>

int foo(int n) {
  return n*2;
}

int main(void) {
  int i;
  i=foo(42);
  puts("Hello, world!\n");
  return 0;
}

on the line i=foo(42);, I do get documtation, with point in foo and with point between the parens. Also with point before i=, I get i's type.

ikirill commented 7 years ago

This seems to have changed at some point: now with printf("Hello world"), point within parentheses, I get the eldoc message printf(const char *, ...) => int, which is not empty, although kinda useless.