1. A computer-implemented method, comprising: building and storing an index of source code files in one or more memory devices, 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 from a client device a search query and a current context, wherein 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 by applying 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 the ranking of the plurality of source code files to the client device as a response to the search query.
1. A computer-implemented method, comprising: building and storing an index of source code files in one or more memory devices, 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 from a client device a search query and a current context, wherein 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 by applying 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 the ranking of the plurality of source code files to the client device as a response to the search query. 5. The method of claim 1 , further comprising: receiving the search query and the current context from a client, where the search query and current context are formatted according to an s-expression protocol and include a command and at least one attribute of the search query; and wherein communicating the ranking of the plurality of source code files further comprises: formatting the ranking of the plurality of source code files as an s-expression formatted list including one or more tags that satisfy the search query, the list also including for each tag, a snippet of a line within a source code file that defines the tag, a path to the source code file, a line number of a definition of the tag in the source code file, and an offset into the source code file corresponding to the tag definition; and sending the formatted ranking of files to the client.