Author Topic: Copy list of all function definitions in a file to clipboard  (Read 3736 times)

shaunp

  • Community Member
  • Posts: 16
  • Hero Points: 0
Copy list of all function definitions in a file to clipboard
« on: December 07, 2010, 08:14:08 pm »
Hi all,

Slickedit shows me a list of all function definitions in a drop-down menu but is there a way to copy this list to the clipboard?  Similar question for function references, global variable defs/refs, etc.?

Thanks,
Shaun

hs2

  • Senior Community Member
  • Posts: 2754
  • Hero Points: 291
Re: Copy list of all function definitions in a file to clipboard
« Reply #1 on: December 07, 2010, 10:09:27 pm »
@shaunp: This would require some SE macro extensions and maybe the SlickTeam will add that to future versions.
For the time being you might give this macro a try.
It's supports copy/append to clipboard either by line/char (i.e. concatenated) of the configurable, filtered tag list shown of the current file.
HS2

shaunp

  • Community Member
  • Posts: 16
  • Hero Points: 0
Re: Copy list of all function definitions in a file to clipboard
« Reply #2 on: December 07, 2010, 10:26:57 pm »
Thanks!  I'll check this out.

Best,
Shaun

Graeme

  • Senior Community Member
  • Posts: 2677
  • Hero Points: 334
Re: Copy list of all function definitions in a file to clipboard
« Reply #3 on: December 08, 2010, 10:41:47 am »
Another possibility.  In both the refs and defs toolbars, in the right click menu there is a menu option "contents" which has a sub-menu that lets you copy the whole tree or a sub-tree or just the selected item.

Graeme

ScottW, VP of Dev

  • Senior Community Member
  • Posts: 1471
  • Hero Points: 64
Re: Copy list of all function definitions in a file to clipboard
« Reply #4 on: December 08, 2010, 03:38:28 pm »
What is it you're trying to do? After you have copied those definitions, what next?

hs2

  • Senior Community Member
  • Posts: 2754
  • Hero Points: 291
Re: Copy list of all function definitions in a file to clipboard
« Reply #5 on: December 08, 2010, 06:44:24 pm »
@Scott: I'm using it (copy symbols) very rarely e.g. when writing emails or checkin comments.
Sometimes but also very rarely I'm using it to copy'n paste a declaration resp. signature (.c[pp]<->.h).
@shaunp: Almost always I make heavy use of the extremely useful completion facilties (symbol,word) of SE.
Just in case you're not aware of it...
HS2

shaunp

  • Community Member
  • Posts: 16
  • Hero Points: 0
Re: Copy list of all function definitions in a file to clipboard
« Reply #6 on: December 08, 2010, 08:38:33 pm »
Hi Scott,

We're porting our app to a new library and I'm creating a report to scope the work needed.  I need to estimate the time to create my report, so I wanted a quick count of the global functions/variables/macros in the library.  After some poking around I started using doxygen and this got me the list I needed and I just counted manually.  I also checked Graeme's solution and it creates a similar list for each file (thanks!).  I also wanted a list in addition to a count so I can use it as a checklist to make sure I'm not leaving anything out.  I've got more to scope but this was a main item.

BTW - Coming up, I'll need to identify the external references from our apps and this library.  Is there an option to show functions/variables/macros/headers/etc. which are referenced in a project but not defined?  GNU nm/objdump gives me some of the solution, but it may miss things which are conditionally excluded.  Thanks!

Regards,
Shaun

ScottW, VP of Dev

  • Senior Community Member
  • Posts: 1471
  • Hero Points: 64
Re: Copy list of all function definitions in a file to clipboard
« Reply #7 on: December 10, 2010, 02:58:45 pm »
Thanks for the info. I'm always trying to understand how other people work so we can better plan the features that will help you. As you might guess, SlickEdit does best what we use it for in-house. I have filed a CR to put a checkbox on Find Symbol to "Send output to buffer".

Will that accomplish what you need? The usual disclaimer about not being able to promise when we'll do that applies.