GNU bug report logs - #74448
30.0.92; c-ts-mode outlines only work with GNU or emacs style

Previous Next

Package: emacs;

Reported by: Filippo Argiolas <filippo.argiolas <at> gmail.com>

Date: Wed, 20 Nov 2024 22:23:01 UTC

Severity: normal

Found in version 30.0.92

Fixed in version 31.0.50

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


Message #32 received at 74448 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Filippo Argiolas <filippo.argiolas <at> gmail.com>
Cc: 74448 <at> debbugs.gnu.org
Subject: Re: bug#74448: 30.0.92; c-ts-mode outlines only work with GNU or
 emacs style
Date: Thu, 30 Jan 2025 09:28:15 +0200
> Feel free to improve on this if you decide to install it

Hi, Filippo.

Do you remember why we removed this condition from
'c-ts-mode--defun-name':

  (equal (treesit-node-type (treesit-node-parent node))
         "function_definition")

Without this condition outline headings are added to every single line
of function_declarator, e.g.:

  int clusterAddNode(clusterNode *node);

  int clusterLoadConfig(char *filename) {
    FILE *fp = fopen(filename,"r");
  }
=>
  (translation_unit
   (declaration type: (primitive_type)
    declarator: 
     (function_declarator declarator: (identifier)
     ...
    ;)
   (function_definition type: (primitive_type)
    declarator: 
     (function_declarator declarator: (identifier)
     ...

The first function_declarator should not be matched
because it has no function_definition parent.




This bug report was last modified 191 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.