Virtual directory for source code navigation
AssigneeMicrosoft Technology Licensing, LLC
InventorBENJAMIN JOHN MCMORRAN
Life of this patent
Estimating the term…
Abstract
A virtual directory is created in a software development tool that lists the files having source code components (e.g., files, functions, methods, types, classes) of a codebase that relate to a user query about the codebase. The files of the codebase are partitioned into chunks with each chunk having a respective embedding. A search for the source code components relevant to the query is performed using an embedding of the query and the chunk embeddings representing the files of codebase. As a file of the virtual directory is edited, the chunk embeddings are updated and the virtual directory is updated with a reference to the revised file.
Claims20
A system for source code navigation of a codebase during an edit session in a software development tool, comprising:
- a processor, and
- a memory that stores a program configured to be executed by the processor, the program comprising instructions that when executed by the processor perform acts that:
- receive a query for a source code component of the codebase during the edit session in the software development tool;
- encode the query using an encoder to generate an embedding of the query in an embedding space;
- create a virtual directory in a user interface of the software development tool, wherein the virtual directory stores filenames of one or more files of the codebase having a source code component related to the query, each source code component of the codebase associated with an embedding in the embedding space, wherein the virtual directory comprises a name including the query;
- search for the one or more files having source code components related to the query, wherein the search finds a source code component of the codebase having an embedding that is similar to the embedding of the query;
- output filenames of the one or more files having the source code components related to the query in the virtual directory of the user interface;
- upon detection of user input selecting one of the output filenames in the virtual directory, display the source code component associated with the select one of the output filenames in the user interface;
- monitor changes made to a select one of the one or more files having source code components related to the query in the virtual directory;
- and
- update the embeddings of the source code components of the select one of the one or more files having source code components in the virtual directory.
A computer-implemented method for source code navigation of a codebase during a software development session in a software development tool, comprising:
- obtaining a query for a source code component of the codebase;
- accessing a plurality of chunks of the codebase, wherein a chunk represents a portion of a file of the codebase;
- associating an embedding of an embedding space with each chunk of the plurality of chunks;
- generating an embedding of the query in the embedding space;
- searching the plurality of chunk embeddings for a chunk embedding similar to the query embedding;
- selecting a file of the codebase associated with the chunk embedding having a similar embedding as the query embedding;
- creating a virtual directory that references the selected file of the codebase associated with the chunk embedding having a similar embedding as the query embedding in a user interface of the software development tool, wherein the virtual directory comprises a name including the query;
- upon receiving user input to display a source code component in the selected file, displaying the source code component of the selected file in the user interface of the software development tool;
- monitoring a change made to the selected file of the codebase having the similar embedding to the query embedding;
- and
- updating the selected file of the codebase having the change made in the virtual directory.
A hardware storage device having stored thereon computer executable instructions that are structured to be executable by a processor of a computing device to thereby cause the computing device to perform actions that:
- provide a virtual directory in a user interface of a software development tool, wherein the virtual directory references files having results of a query related to source code components contained in files of a codebase, wherein the virtual directory comprises a name including the query;
- represent contents of the files of the codebase as a plurality of chunks, wherein a chunk of the plurality of chunks is represented by a chunk embedding;
- receive a query pertaining to a target source code component of the codebase;
- generate an embedding of the query;
- search the plurality of chunks for chunk embeddings similar to the query embedding;
- obtain the files corresponding to the chunk embeddings that are similar to the query embedding;
- output filenames of the files corresponding to the chunk embeddings that are similar to the query embedding in the virtual directory;
- monitor a change made to the selected file of the codebase having the similar embedding to the query embedding;
- and
- update, in the virtual directory, the selected file of the codebase having the change.
Dependencies are inferred from the claim text.