10. A computer program product, encoded on a machine-readable storage device or a machine-readable storage substrate, configured to cause a data processing apparatus to perform operations comprising: building an index of source code files, the index incorporating one or more tags and, for each tag, a name of a respective source code file in which the tag is defined, a path to the respective source code file relative to a root directory, and a representation of an include-tree of the respective source code file, where the include-tree is a sequence of files that are included by or imported by the respective source code file; receiving a search query and a current context, where the current context is a file being edited, the current context is in a directory in a path relative to the root directory, and the current context has an associated include-tree; searching the index and identifying a plurality of source code files that define tags that satisfy the search query, the plurality of source code files including a plurality of source code files that are in the include-tree of the current context and at least one file that is not in the include-tree of the current context; ranking each of the plurality of source code files that define tags that satisfy the search query by applying a multiple levels of sorting, including a first level of sorting where all source code files that are in the include-tree of the current context are ranked higher than all source code files that are not in the include-tree of the current context, and a second level of sorting where all source code files in the include-tree of the current context are ranked by the relative directory distance from the current context to each source code file; and communicating an indicator of the plurality of source code files that define tags that satisfy the search query as a response to the search query.
10. A computer program product, encoded on a machine-readable storage device or a machine-readable storage substrate, configured to cause a data processing apparatus to perform operations comprising: building an index of source code files, the index incorporating one or more tags and, for each tag, a name of a respective source code file in which the tag is defined, a path to the respective source code file relative to a root directory, and a representation of an include-tree of the respective source code file, where the include-tree is a sequence of files that are included by or imported by the respective source code file; receiving a search query and a current context, where the current context is a file being edited, the current context is in a directory in a path relative to the root directory, and the current context has an associated include-tree; searching the index and identifying a plurality of source code files that define tags that satisfy the search query, the plurality of source code files including a plurality of source code files that are in the include-tree of the current context and at least one file that is not in the include-tree of the current context; ranking each of the plurality of source code files that define tags that satisfy the search query by applying a multiple levels of sorting, including a first level of sorting where all source code files that are in the include-tree of the current context are ranked higher than all source code files that are not in the include-tree of the current context, and a second level of sorting where all source code files in the include-tree of the current context are ranked by the relative directory distance from the current context to each source code file; and communicating an indicator of the plurality of source code files that define tags that satisfy the search query as a response to the search query. 12. The product of claim 10 , wherein building an index of source code files further comprises: receiving one or more s-expression formatted TAGS file, each TAGS file corresponding to one or more source code files and containing, for each source code file, a name of the source code file, a path to the source code file, a language of the source code file, one or more tags defined in the source code file, a location of each tag defined within the source code file, and an item descriptor of each tag defined within the source code file; storing the one or more TAGS files; and using the one or more TAGS files to build the index of source code files.