Code completion
AssigneeAffirm, Inc.
InventorsAdam Smith, Tarak Upadhyaya, Juan Lozano, Daniel Hung
Life of this patent
Estimating the term…
Abstract
A system and method may provide assistance to programmers during programming to reduce the number of routine tasks that must be performed. In some aspects, the system may suggest one or more code snippets that comprise code completions. The code snippets may be single or multi-token. In some aspects, the system may provide predictive editing or predictive navigation, where the system may predict edits or navigation actions based on a programmer's actions. In some aspects, the system is based on machine learning methods and is trained on past actions of programmers in a code editor.
Claims38
A computer-implemented method comprising:
- receiving edits at a cursor location in a code editor from a programmer;
- updating source code at the cursor location in response to the edits received from the programmer;
- detecting, with a code completion system, an event to trigger code completion;
- determining features of the source code near the cursor location, wherein the features include one or more tokens near the cursor location;
- using the features to search for code snippets in a team or local data set and to generate code snippets based on one or more models trained using the team or local data set;
- identifying or generating one or more candidate code snippets;
- predictively determining a selection of one of the candidate code snippets as a selected code snippet without user input or selection;
- and
- automatically modifying, with the code completion system, and without user input or selection, the source code by inputting the selected code snippet into the source code,
- wherein the one or more trained models further employ machine learning to identify actions that lead to a navigation, and learn the navigation to be performed to suggest the navigation to the programmer,
- wherein the team or local data set is specific to prior code snippet selections made by a member of the team or an individual user on the team, and
- wherein the team or local data set includes both positive and negative examples of the prior code snippet selections.
A computer-implemented method comprising:
- receiving edits at a cursor location in a code editor from a programmer;
- updating source code at the cursor location in response to the edits received from the programmer;
- detecting, with a code completion, an event to trigger code completion;
- determining features of the source code near the cursor location, wherein the features include one or more tokens near the cursor location;
- using the features to search for code snippets in a team or local data set and to generate code snippets based on one or more models trained using the team or local data set;
- identifying or generating one or more candidate code snippets, wherein the one or more candidate code snippets are multi-token code snippets and the candidate code snippets contain content, the content of the candidate code snippets being adapted to a source code context at the cursor location;
- predictively determining a selection of one of the candidate code snippets as a selected code snippet without user input or selection;
- and
- automatically modifying, with the code completion system, and without user input or selection, the source code by inputting the selected code snippet into the source code,
- wherein the one or more trained models further employ machine learning to identify actions that lead to a navigation, and learn the navigation to be performed to suggest the navigation to the programmer,
- wherein the team or local data set is specific to prior code snippet selections made by a member of the team or an individual user on the team, and
- wherein the team or local data set includes both positive and negative examples of the prior code snippet selections.
A computer-implemented method comprising:
- receiving edits at a cursor location in a code editor from a programmer;
- updating source code at the cursor location in response to the edits received from the programmer;
- detecting, with a completion system, an event to trigger code completion;
- receiving one or more keywords;
- determining features of the source code near the cursor location, wherein the features include one or more tokens near the cursor location;
- using the features and the one or more keywords to search for code snippets in a team or local data set and to generate code snippets based on one or more models trained using the team or local data set;
- identifying or generating one or more candidate code snippets, wherein the one or more candidate code snippets are multi-token code snippets;
- predictively determining a selection of one of the candidate code snippets as a selected code snippet without user input or selection;
- and
- automatically modifying, with the code completion system, and without user input or selection, the source code by inputting the selected code snippet into the source code,
- wherein the one or more trained models further employ machine learning to identify actions that lead to a navigation, and learn the navigation to be performed to suggest the navigation to the programmer,
- wherein the team or local data set is specific to prior code snippet selections made by a member of the team or an individual user on the team, and
- wherein the team or local data set includes both positive and negative examples of the prior code snippet selections.
Dependencies are inferred from the claim text.