unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Yuan Fu <casouri@gmail.com>
To: e190@163.com
Cc: Eli Zaretskii <eliz@gnu.org>, 60296 <60296@debbugs.gnu.org>
Subject: bug#60296: The imenu is not created properly in c-ts-mode
Date: Mon, 26 Dec 2022 01:47:32 -0800	[thread overview]
Message-ID: <876EAEFC-650C-4D0E-BD2A-637F7887C146@gmail.com> (raw)
In-Reply-To: <2022122615584707191012@163.com>



> On Dec 25, 2022, at 11:58 PM, e190@163.com wrote:
> 
> >> On Dec 24, 2022, at 10:53 PM, Eli Zaretskii <eliz@gnu.org> wrote:
> >>
> >>> Cc: 60296-done@debbugs.gnu.org
> >>> From: Yuan Fu <casouri@gmail.com>
> >>> Date: Sat, 24 Dec 2022 19:00:21 -0800
> >>>
> >>>> From: sniper <e190@163.com>
> >>>> To: bug-gnu-emacs@gnu.org
> >>>> Subject: 29.0.60; The imenu is not created properly in c-ts-mode.
> >>>>
> >>>> ``` c
> >>>> char *test(int size){
> >>>> return NULL;
> >>>> }
> >>>> ```
> >>>> If c-ts-mode is enabled in a c file, the imenu created will be [` test(int size)`] if the return type of the function is a
> >>>> pointer.
> >>>> The expected display should just be the function name [` test `], with no subsequent arguments
> >>>
> >>> Thanks, this should be fixed now.
> >>
> >> This change leads to
> >>
> >>  In c-ts-mode--fontify-declarator:
> >>  progmodes/c-ts-mode.el:405:69: Warning: Unused lexical argument `args'
> >>
> >> And "&rest args" is indeed unused there, AFAICT.
>  
> >My bad. I’ve fixed that by changing args to _.
> Hi, Yuan:
> 
> I tested it in the latest version and found several more issues.
> ``` c
> int main(int argc, char *argv[])
> {
> .....
>    struct name_t name = (struct name_t)name;
>    name.a = sizeof(struct name_t);
> .....
> }
> ```
> If Forced conversion or ` sizeof(struct name_t) ` occurs in a function, it will occur in the Struct entry of imenu.
> 
> 
> ``` c
> int func_1(int v);  //  <-- function declaration
> int main(int argc, char *argv[])
> {
> }
> ```
> If there is a function declaration in the c file, it will also appear in imenu's Variable entry.

Thanks, I fixed those. Further more, I improved the whole imenu thing in c-ts-mode and it should be robust now.

Yuan




  reply	other threads:[~2022-12-26  9:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-24  9:31 bug#60296: The imenu is not created properly in c-ts-mode e190
2022-12-25  3:00 ` Yuan Fu
2022-12-25  6:53   ` Eli Zaretskii
2022-12-25  8:31     ` Yuan Fu
2022-12-26  7:58       ` bug#60296: " e190
2022-12-26  9:47         ` Yuan Fu [this message]
2022-12-27 10:03           ` e190

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=876EAEFC-650C-4D0E-BD2A-637F7887C146@gmail.com \
    --to=casouri@gmail.com \
    --cc=60296@debbugs.gnu.org \
    --cc=e190@163.com \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).