Code Snippet Recommendation for Object Literal Properties

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Developers face inefficiencies in identifying properties of object literals in code, leading to a temporal and mental burden due to memorization and manual searching, especially when dealing with complex functions like jQuery.ajax() that accept property bags with numerous settings.

Innovation Solution

Implementing a system that recommends content for code snippets to define object literals using global dynamic analysis based on getter traps or by analyzing comments, providing auto-complete and recommendation functionality to reduce the need for manual information retrieval.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Loss of information

If developers manually search through reference materials to find property information, then they can identify the required information, but it consumes substantial time and resources

Engineering Contradiction:
Improveproperty information retrievalVSAvoidtime for manual searching
Core Design Contradiction:
Loss of informationVSLoss of time

Solution Approach 1:

The system enables self-service by automatically analyzing code context and generating property information without requiring developers to manually search reference materials. The analysis engine autonomously extracts property names, types, and descriptions from the codebase, serving the information need internally rather than requiring external lookup

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

The system performs preliminary action by pre-analyzing code contexts and preparing property information in advance. When a developer needs property information, it is already available from prior static analysis, eliminating the need for real-time manual searching through documentation

Inventive Principle:
Principle #10Preliminary action

2Loss of information

If developers manually search for property information, then they can find the required data, but it consumes substantial computing resources

Engineering Contradiction:
Improveproperty information retrievalVSAvoidcomputing resources for searching
Core Design Contradiction:
Loss of informationVSUse of energy by moving object

Solution Approach 1:

The system performs property information extraction in advance through static analysis during code parsing, rather than consuming resources during developer interaction. The analysis engine pre-computes property metadata from code structures, making information readily available without real-time resource consumption

Inventive Principle:
Principle #10Preliminary action

3Loss of time

If developers memorize property information, then they can quickly access it, but it creates substantial temporal and mental burden

Engineering Contradiction:
Improvetime to access property informationVSAvoiddeveloper cognitive load
Core Design Contradiction:
Loss of timeVSEase of operation

Solution Approach 1:

The system eliminates the need for developer memorization by providing self-service information retrieval. When developers need property information, the system automatically analyzes the code context and presents relevant property details, freeing developers from both memorization burden and manual searching

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

The system acts as an intermediary between the codebase and the developer, translating code structures into understandable property information. Rather than requiring developers to remember raw property details or search documentation, the intermediary engine automatically extracts and presents relevant information in context

Inventive Principle:
Principle #24Intermediary (Mediator)

Data Source

PatentUS10162605B2Code snippet content recommendation to define an object literal
Publication Date: 2018.12.25 MICROSOFT TECHNOLOGY LICENSING LLC
  • US10162605B2 patent drawing
  • US10162605B2 patent drawing
  • US10162605B2 patent drawing

AI summary

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.