Tagging Files

Supported Tagging Formats

Multi-Tags

Multi-Tags is an easy to use, hypertext-like source code browser. Run your source files through the Multi-Tags scanner to produce a database of functions/procedures, structures, types, etc., depending on the language being scanned. Once the database is created, position your cursor on any function name (or other supported language object), right click the mouse to get the context menu, and select Find tag under cursor (or hit a hot key if one is defined. 'CTRL+F9' for default CUA keymap). Multi-Tags will then locate the source file where that tag was defined and take your cursor to the definition. If a tag was defined in more than one place or file, then Find again will locate the next occurrence.

View | Tags opens a tree list of the current tag file in the Navigation Pane that allows you to select any tag and move immediately to its definition. (if Tags is already checked, then use View | Navigation Pane).

Another way to use Multi-Tags is to load a code file into Multi-Edit and click the button on the toolbar. If Multi-Edit has Tag support for the language it will display a list of all the functions in that file. Click on the list to quickly jump to that function.

Tags generally include functions, subroutines, classes, and in some cases defined variables. What tags are found within a source file is dependent on the find tag macro that is defined under the language setup.

Currently Multi-Edit supports tags for ADA, C/C++/C#, CMac, DBase/xBase/CLIPPER, Fortran, Java, JavaScript, Lisp, Lua, Matlab, Modula-2, Pascal, Perl, Php, Pl_Sql, Progress, Python, Rebol, Ruby, SciLab, TclTk, VBasic, Verilog, and Vhdl. Plus support for other languages can be added (see Adding Function Tagging in the Adding Language Support chapter). Also any text file may contain tags via explicit tags.

For an alternate explanation of Multi-Edit Tags see Introduction to CMac. 7: Multi-Edit Tags in the User Created Macros forum of the Multi-Edit web site (www.multieditsoftware.com/forums)

Explicit Tags

A line of source may be explicitly tagged by adding @Metags by a tag identifier on the line, probably in a comment. For example:

if( jx== 10 )    	// @METAGS wow
{ 
  fprint("Wow!!");
}

CTags

Creating Tag Database

Multi-Edit maintains tags using a flat file database system. Tag databases use the naming convention <language>.tag where <language> is the language the tags where created for. Tag databases either are created by scanning the current file, scanning the files within a project, or by using the wildcard tag scan feature.

Not all languages support the Multi-Tags feature. To see if the language you are using supports Multi-Tags, verify that a Find Tag macro has been created and is specified in the language setup dialog. Go to Tools | Customize | General | Languages, select your language and click ‘Edit’. In the resulting Language Setup dialog look for the “FindTag” field in the “Macros” section (right side). If that field is blank, then no FindTag macro is set up for this language. See Adding Function Tagging in the Adding a New Language section of chapter Adding Language Support for information on creating a FindTag macro.

Tag Scan

To scan the current file for tags, select Tags | Scan Tags For Current File. Alternatively, if the Tag View (View | Tags) is displayed, the Scan File button may be used.

Project Scan

Scanning a project for tags will scan ALL files contained in the project. If a project has been created, click on Tags | Scan Project. Alternatively, if the Tag View is displayed, the Scan Project button may be used.

Wildcard Tag Scan

The Wildcard Tag Scan feature scans based on a user defined directory and file mask. Primarily, this is used for scanning multiple files with the same extension. For example, specifying the following path and mask in the Wildcard Tag Scan dialog would scan all CMac source files creating the Cmac.tag database.

	Directory:    C:\Program Files\Multi-Edit 2008\src\
	Filespec(s):  .s;.sh

Select Tags | Wildcard Tag Scan to view the Wildcard Tag Scan dialog. Alternatively, if the Tag View is displayed, the Wildcard Tag Scan button may be used.

Using The Tag View

Multi-Edit's Tag View is a graphical user interface for accessing and maintaining Multi-Tags. Tag databases can be created or loaded (automatically or manually) and source files with corresponding tags can be selected and viewed quickly.

Here's how it works…

When a file is opened or switched to, the Tag View automatically loads the corresponding Multi-Tags database based on that filename's extension and attempts to select the file from within the database and display the tags contained in the file.

If the file is not found, the first file in the database is displayed. Alternatively, a Multi-Tags database can be manually loaded by clicking on the Load Tag File icon or switched to using the drop down list. Manually loading a database is most often used for locating tags (function implementations) in a file that is not already loaded or referenced from a loaded file.

Source and Tag Lists

The Tag View has two lists that work together. The first is a list of all source files within the currently loaded Multi-Tag database. The second is a list of all tags contained in the selected file from the first list. Both source files and tags may be removed from these lists (and the Multi-Tag database) by right clicking the file or tag and selecting the “remove tag / file” option. Double clicking on a tag or selecting a tag and pressing the enter key will load the file the tag is located in and position the cursor at the tag.

Creating / Updating a Multi Tag Database (Scanning Files)

Files can be scanned using the Tags view by selecting one of the four methods below.

Scan File button: Scans the current file
Scan All Files button: Re-scans all files within the Multi Tags database
Scan Project: Scans all files contained in the current project
Wildcard Scan: Allows the use of wildcards to scan multiple files in one or more directories.

Using any one of the above methods will create and/or update the Multi-Tags database.

 Display Tags and Files vs.   Display All Tags 

The Tag View offers the option of displaying all of the tags contained in the Multi-Tags database. This is different from the default display, which requires a source file to be selected and displays only tags for the selected source file. When the Display All Tags button is clicked, all the tags in all the files in the source file list are listed. The source file list is disabled, but when a tag is selected the corresponding source file will be automatically selected for reference.

Tags And Projects

When a project is specified, Tags are configured within the project settings that take precedence over the Multi-Tags language based configurations. By default, tag databases are stored in the project's root directory. However, this can be changed by clicking on Project | Properties and specifying the desired path on the Directories tab.

Once the desired Tags directory is defined, the entire project can be scanned by clicking on Tags | Scan Project or by using the 'Scan Project' button on the Tag View.

 
doc/manual2k8/tags.txt · Last modified: 2008/07/09 14:53 (external edit)     Back to top