[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#60397: 29.0.60; c++-ts-mode could report better defun names
From: |
Yuan Fu |
Subject: |
bug#60397: 29.0.60; c++-ts-mode could report better defun names |
Date: |
Sun, 1 Jan 2023 16:27:08 -0800 |
Knut Anders Hatlen <kahatlen@gmail.com> writes:
> The defun names reported by c++-ts-mode could still need a couple of
> improvements:
>
> 1) In a buffer with c++-ts-mode and which-function-mode enabled, and
> this content:
>
> struct S {
> int f1(int x) {
> return x + 1;
> }
> int g1(int x);
> };
>
> int S::g1(int x) {
> return x + 1;
> }
>
> Inside the inline f1 function definition, which-function-mode shows
> "S.f1". But inside the out-of-line g1 function definition, it shows
> "n/a" instead of "S.g1". (Not limited to structs. Classes have the same
> problem.)
>
> 2) Namespaces are not handled. Given this content:
>
> namespace n {
> int f1(int x) {
> return x + 1;
> }
> }
>
> namespace {
> int f2(int x) {
> return x + 1;
> }
> }
>
> Inside the f1 and f2 function bodies, which-function-mode shows "f1" and
> "f2", respectively. It would be better if it showed "n.f1" for the
> former, and perhaps something like "(anonymous).f2" for the latter.
Thanks for the report. I’ll work on this :-)
Yuan
- bug#60397: 29.0.60; c++-ts-mode could report better defun names,
Yuan Fu <=