emacs-vs / ts-docstr

A document string minor mode using tree-sitter
https://emacs-vs.github.io/ts-docstr/
GNU General Public License v3.0
39 stars 4 forks source link

Cannot insert docstrings for C functions with struct arguments #9

Open space-jam- opened 1 year ago

space-jam- commented 1 year ago

If a C function is declared like:

struct point {
    int x;
    int y;
};

int foo(struct point p) {
     return p.x + p.y;
}

ts-docstr-at-point will fail with the error:

user-error: Multiple declarations are invalid, 2.

I think this is triggered by the use of the struct keyword, as a basic or typedef name won't cause this issue.

jcs090218 commented 1 year ago

Ah, yes. You probably right. struct is caught as the declarations...

This might be hard to solve. 🤔