Ticket #267 (closed defect: fixed)

Opened 10 years ago

Last modified 9 years ago

Editor's enhancement: C-code navigation via tags

Reported by: angel_il Owned by: angel_il
Priority: major Milestone: 4.7.0-pre2
Component: mcedit Version: 4.7.0-pre1
Keywords: codejump Cc:
Blocked By: Blocking:
Branch state: Votes for changeset: committed-master

Description (last modified by angel_il) (diff)

It would be good to have possibility in the mcedit to navigate to function definition. Using for this purpose the utility etags and parse "TAGS" file in the current directory or parent.

For make TAGS do

$find . -type f -name "*.[ch]" | etags -l c --declarations -

Alt+Enter call listbox with files declarations.

Attachments

0001-Add-stack-navigation-structure.-Add-hotkeys-A-ba.patch (16.7 KB) - added by angel_il 10 years ago.

Change History

comment:1 Changed 10 years ago by angel_il

  • Summary changed from C code navigation in mcedit to C-code navigation in mcedit

comment:2 Changed 10 years ago by angel_il

  • Summary changed from C-code navigation in mcedit to Editor's enhancement: C-code navigation via tags

comment:3 Changed 10 years ago by angel_il

  • Status changed from new to accepted
  • Owner set to angel_il

comment:4 Changed 10 years ago by angel_il

  • Description modified (diff)

comment:5 Changed 10 years ago by angel_il

  • Description modified (diff)

comment:6 Changed 10 years ago by angel_il

  • Keywords review added

comment:7 follow-up: ↓ 9 Changed 10 years ago by slavazanko

  • Keywords rework added; review removed

I think, need little rework.

As first, etags is a part of big emacs, I propose use ctags instread:

ctags --languages=c -e -R -h '[ch]'

As second, patch little bit dirty. See changeset:8abf76df7c3140e85d2a83391c4ee54bd52a0924

And as third, IMHO works not correctly:

  1. run "ctags --languages=c -e -R -h '[ch]'" on mc source tree
  2. open for edit vfs/samba/lib/username.c:189 (stay on StrnCpy at char 'C')
  3. press ALT+Enter (or ESC,Enter)

list box show not only StrnCpy implementation link. May be, this feature, but as for me this don't intuitive :)

comment:8 Changed 10 years ago by slavazanko

Need to describe new hotkeys:

  • ALT+- (minus) - Go to previous function in navigation list
  • ALT+= (equal) - Go to next function in navigation list

And, of course, Esc,-(minus) and Esc,=(equal) works in parallel to ALT+... hotkeys.

This mean, need to add descriptions in *.hlp files and man-pages.

comment:9 in reply to: ↑ 7 Changed 10 years ago by angel_il

As first, etags is a part of big emacs, I propose use ctags instread:

ctags --languages=c -e -R -h '[ch]'

correct

 ctags -e -R *.[ch]

comment:10 Changed 10 years ago by angel_il

  • ALT+- (minus) - Go to back in navigation list (like a browser Back)
  • ALT+= (equal) - Go to forward (like a browser Forward)

comment:11 Changed 10 years ago by slavazanko

  • Keywords review vote-slavazanko added; rework removed

Last changes in branch looks good. All works fine. My vote here.

comment:12 Changed 10 years ago by andrew_b

  • Keywords vote-andrew_b added; review removed

It will be great if you will provide a user menu entry "Create tags for this directory".
But anyway my vote here.

comment:13 Changed 10 years ago by angel_il

  • Keywords commited:master added; vote-slavazanko vote-andrew_b removed

comment:14 Changed 10 years ago by angel_il

  • Status changed from accepted to testing
  • Resolution set to fixed

comment:15 Changed 10 years ago by angel_il

  • Status changed from testing to closed

comment:16 Changed 10 years ago by styx

  • Keywords commited-master added; commited:master removed

comment:18 Changed 10 years ago by slavazanko

wtf?

comment:19 Changed 10 years ago by andrew_b

  • severity changed from no branch to merged

comment:20 Changed 10 years ago by andrew_b

  • Status changed from closed to reopened
  • severity changed from merged to no branch
  • Type changed from enhancement to defect
  • Priority changed from minor to major
  • Version changed from 4.6.2 to 4.7.0-pre1
  • Milestone changed from 4.7 to 4.7.0-pre2
  • Keywords codejump added; commited-master removed
  • Resolution fixed deleted

Digits which are in the function name are added to the line number.

comment:21 Changed 10 years ago by angel_il

  • severity changed from no branch to on review

branch: 267_fix_line_num
changeset: 10b4826383cc903ffe6d6c4366834ed203847ef6

comment:22 Changed 10 years ago by angel_il

comment:23 Changed 10 years ago by andrew_b

  • Votes for changeset set to andrew_b

comment:24 Changed 10 years ago by iNode

  • Votes for changeset changed from andrew_b to andrew_b iNode
  • severity changed from on review to approved

comment:25 Changed 10 years ago by angel_il

  • Status changed from reopened to closed
  • Votes for changeset changed from andrew_b iNode to commited-master
  • Resolution set to fixed
  • severity changed from approved to merged
Note: See TracTickets for help on using tickets.