# US 2018/0024816 A1 · Code snippet content recommendation to define an object literal

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2018/0024816 A1
- Document ID: US20180024816A1
- Status: Published application
- Kind: A1
- Application number: 15/249,244
- Filed: 2016-08-26
- Published: 2018-01-25
- Earliest claimed: 2016-07-20
- Assignees: Microsoft Technology Licensing, LLC
- Applicants: Microsoft Technology Licensing, LLC
- Inventors: Yinghung Au; Nikhil Khandelwal
- Web page: https://patentgrep.com/patent/US20180024816A1

## CPC

- G06F 8/33: Intelligent editors
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Techniques are described herein that are capable of recommending content of a code snippet to define an object literal. For instance, information regarding one or more properties of the object literal is determined. The content of the code snippet is recommended to define the object literal based at least in part on the information. The content identifies the one or more properties of the object literal. In a first example, the information may be determined from comment(s) that are included in code. In a second example, a proxy object may be provided to a function that is included in code. In accordance with this example, the information regarding the one or more properties of the object literal may be determined using global dynamic analysis based at least in part on a getter trap that is encountered during execution of the function with regard to the proxy object.

## Claims

### Claim 1

A system to intelligently complete a code snippet to define an object literal, the system comprising:
provision logic configured to provide a proxy object to a function that is included in code;
determination logic configured to determine information regarding one or more properties of the object literal using global dynamic analysis based at least in part on a getter trap that is encountered during execution of the function with regard to the proxy object; and
recommendation logic configured to recommend content of the code snippet to define the object literal based at least in part on the information, the content identifying the one or more properties of the object literal.

### Claim 2 (depends on 1)

The system of claim 1, wherein the provision logic is configured to provide the proxy object as an argument to the function; and
wherein the determination logic is configured to determine the information regarding the one or more properties that are requested with respect to the object literal based at least in part on the getter trap that is encountered during the execution of the function with regard to the proxy object.

### Claim 3 (depends on 1)

The system of claim 1, wherein the determination logic is configured to infer one or more names of the one or more respective properties based at least in part on the information.

### Claim 4 (depends on 1)

The system of claim 1, wherein the determination logic is configured to infer one or more syntaxes of the one or more respective properties based at least in part on the information.

### Claim 5 (depends on 1)

The system of claim 1, wherein the determination logic is configured to determine the information regarding the one or more properties of the object literal based at least in part on the getter trap that is encountered with regard to one or more nested function calls that are included in the function, the one or more nested function calls referencing at least one of the one or more properties.

### Claim 6 (depends on 1)

The system of claim 1, wherein the determination logic is configured to determine the information regarding the one or more properties of the object literal based at least in part on the getter trap that is encountered with regard to one or more dynamic function calls that are included in the function, the one or more dynamic function calls referencing at least one of the one or more properties.

### Claim 7 (depends on 1)

The system of claim 1, wherein the determination logic is configured to determine the information regarding the one or more properties of the object literal based at least in part on the getter trap that is encountered with regard to one or more recursive function calls that are included in the function, the one or more recursive function calls referencing at least one of the one or more properties.

### Claim 8 (depends on 1)

The system of claim 1, wherein the determination logic is configured to determine the information regarding the one or more properties of the object literal based at least in part on the getter trap that is encountered with regard to one or more definitions of one or more dynamic properties that are included in the function, the one or more definitions of the one or more dynamic properties indicating at least one of the one or more properties.

### Claim 9 (depends on 1)

The system of claim 1, wherein the determination logic is configured to determine that the object literal is to be a designated type selected from a plurality of types based at least in part on the information; and
wherein the recommendation logic is configured to indicate that the object literal is to be the designated type.

### Claim 10 (depends on 1)

The system of claim 1, further comprising:
tooltip logic configured to provide a tooltip that includes information regarding the content.

### Claim 11

A system to intelligently complete a code snippet to define an object literal, the system comprising:
determination logic configured to determine information regarding one or more properties of the object literal from one or more comments that are included in code; and
recommendation logic configured to recommend content of the code snippet to define the object literal based at least in part on the information, the content identifying the one or more properties of the object literal.

### Claim 12 (depends on 11)

The system of claim 11, wherein the determination logic is configured to infer one or more names of the one or more respective properties based at least in part on the information.

### Claim 13 (depends on 11)

The system of claim 11, wherein the determination logic is configured to infer one or more syntaxes of the one or more respective properties based at least in part on the information.

### Claim 14 (depends on 11)

The system of claim 11, wherein the determination logic is configured to determine that the object literal is to be a designated type selected from a plurality of types based at least in part on the information; and
wherein the recommendation logic is configured to indicate that the object literal is to be the designated type.

### Claim 15 (depends on 11)

The system of claim 11, further comprising:
tooltip logic configured to provide a tooltip that includes information regarding the content.

### Claim 16

A method of intelligently completing a code snippet to define an object literal, the method comprising:
providing a proxy object to a function that is included in code;
determining information regarding one or more properties of the object literal using global dynamic analysis based at least in part on a getter trap that is encountered during execution of the function with regard to the proxy object; and
recommending content of the code snippet to define the object literal based at least in part on the information, the content identifying the one or more properties of the object literal.

### Claim 17 (depends on 16)

The method of claim 16, wherein determining the information comprises:
inferring at least one of (a) one or more names of the one or more respective properties based at least in part on the information or (b) one or more syntaxes of the one or more respective properties based at least in part on the information.

### Claim 18 (depends on 16)

The method of claim 16, wherein determining the information comprises:
determining the information regarding the one or more properties of the object literal based at least in part on the getter trap that is encountered with regard to at least one of (a) one or more nested function calls, (b) one or more dynamic function calls, or (c) one or more recursive function calls that are included in the function and that reference at least one of the one or more properties.

### Claim 19 (depends on 16)

The method of claim 16, wherein determining the information comprises:
determining the information regarding the one or more properties of the object literal based at least in part on the getter trap that is encountered with regard to one or more definitions of one or more dynamic properties that are included in the function, the one or more definitions of the one or more dynamic properties indicating at least one of the one or more properties.

### Claim 20 (depends on 16)

The method of claim 16, further comprising:
determining that the object literal is to be a designated type selected from a plurality of types based at least in part on the information;
wherein recommending the content of the code snippet comprises:
indicating that the object literal is to be the designated type.
