> Can someone explain ctags to me? I gather that it is a list of words which BBEdit looks for matches against when doing text coloring, populating the function menu, and completion - but beyond that I'm clueless. I tried to look at the ctags docs and knew instantly my kung-fu was too weak.
The short, short version:
1) Open Terminal
2) cd to the directory where your code is
3) type "bbedit --maketags ."
The important bit, of course, is that you'll need to repeat that process any time you modify your code.
Now when you look at your code in BBEdit you'll see new colours for words corresponding to terms defined elsewhere. Right-click on the word to bring up the context menu, and you'll see an entry for "definitions", which then presents a sub-menu of locations where the term has been defined.
The "--maketags" option is mentioned in passing on p296 of the BBEdit User Guide. Search for "ctags" and you'll find plenty of other information about this service.
Alex
# > man 5 crontab
François
> --
> You received this message because you are subscribed to the
> "BBEdit Talk" discussion group on Google Groups.
> To post to this group, send email to bbe...@googlegroups.com
> To unsubscribe from this group, send email to
> bbedit+un...@googlegroups.com
> For more options, visit this group at
> <http://groups.google.com/group/bbedit?hl=en>
> If you have a feature request or would like to report a problem,
> please email "sup...@barebones.com" rather than posting to the group.
> Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>
Thanks
François
Its easy to miss the dot on the end but the command is bbedit --maketags .
Or specify another directory.
If you don't list the dot then bbedit silently does nothing.
--
David Kelly N4HHE, dke...@HiWAAY.net
========================================================================
Whom computers would destroy, they must first drive mad.
François
So it does. Didn't see the tags file the first time but duped the
directory, nuked the tags file, and ran it again which produced a new
tags file.
>3. when saving the script make sure that it is saved as Script + Run
>only (nb: according to the documentation the script must be compiled
>and I assume Run only option means it is compiled)
I have not experimented with the application under discussion but in
general any AppleScript script saved as such (and not simply as text)
will be compiled. The 'run only' option is simply to stop people
hacking the source code.
JD
François
On Sep 7, 2011, at 2:08 PM, ascarter wrote:
> No you shouldn't need to restart BBEdit. Do you see a "tags" file in the root of your project? Are you running in project mode in BBEdit? You can also open the tags file (it's just text) and see that it has your symbols in it.
>
Lesson learned: don't use the tags generation script as a
documentDidSave event, except you can filter an actual source file
save.
2. The conclusion above made me think that a better event to attach
the tags generation would be the Save action. So I've transformed it
into a File • Save script.
This approach has solved the above issue, but the script in the
current form was not able to make the difference between a real
project (with a folder structure) and a bunch a separate files opened
in the current window.
3. This is the part where I'm asking for help. The script in the
current form can be found at the end of the post. What I'd need help
with is:
3.1 Is there a way to determine if the current window belongs to a
real project vs a set of random files?
3.2. Could someone validate the following code snippet which tries to
get the parent folder if the main script result is a file:
if kind of (info for theFile) is "folder" then
-- Run the maketags script
set thePath to POSIX path of theFile
else
set thePath to POSIX path of (container of theFile)
end if
set cmd to "cd " & thePath & "; /usr/local/bin/bbedit --maketags"
3.3 Is there a way to install this script and trigger it through a
menu item/shortcut against the current project instead of having it
automatically triggered by the Save action?