Partial Code Evaluation for Dynamic Language Completion

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Conventional software development environments face challenges in providing accurate code completion features for dynamic programming languages like JavaScript, as these languages lack a consistent object model, making it difficult to infer the shape and structure of variables and methods, which are often modified at runtime.

Innovation Solution

The method involves loading and executing code modules in a partial code evaluator to generate partial code evaluation results, which are then used to derive code completion information, and caching these results to avoid repeated evaluations and improve performance.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If code completion features are provided for dynamic programming languages by analyzing code modules at runtime, then code completion accuracy is improved, but system performance and editor responsiveness deteriorate

Engineering Contradiction:
Improvecode completion accuracyVSAvoideditor responsiveness
Core Design Contradiction:
Measurement precisionVSProductivity

Solution Approach 1:

The patent performs partial code evaluation in advance to generate code completion information before the user actually needs it. The system proactively analyzes code modules, executes them in a controlled environment, and pre-computes completion data, so that when the user requests code completion, the information is already prepared and can be delivered quickly without blocking the editor's responsiveness.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent divides the code analysis process into separate, independent segments that can be executed in parallel. Instead of analyzing the entire codebase sequentially, the system breaks down code modules into smaller units, evaluates them independently in isolated environments, and combines the results. This segmentation enables concurrent processing and reduces the overall time required for code completion analysis.

Inventive Principle:
Principle #1Segmentation

2Measurement precision

If code modules are executed in a partial code evaluator to generate completion information, then code completion information accuracy is improved, but processing time and computational resources increase

Engineering Contradiction:
Improvecode completion information accuracyVSAvoidprocessing time
Core Design Contradiction:
Measurement precisionVSLoss of time

Solution Approach 1:

The system performs partial code evaluation in advance to generate code completion information before the user actually needs it. The code modules are proactively analyzed, executed in a controlled environment, and pre-computed, so that when code completion is requested, the information is already prepared and can be delivered quickly without blocking editor responsiveness.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent applies partial code evaluation rather than full code execution. Instead of running the entire code module suite, the system selectively evaluates only the portions of code necessary to generate completion information. This partial action approach reduces processing time and computational resource requirements while still achieving accurate code completion data.

Inventive Principle:
Principle #16Partial or excessive action

3Measurement precision

If code completion analysis is performed for each source code document, then code completion accuracy is improved, but system performance deteriorates due to repeated evaluations

Engineering Contradiction:
Improvecode completion accuracyVSAvoidsystem performance
Core Design Contradiction:
Measurement precisionVSProductivity

Solution Approach 1:

The patent creates and stores copies of code completion information in a cache after the first analysis. Instead of re-evaluating code modules for each source code document, the system retrieves pre-computed completion data from the cache. This copying approach eliminates redundant evaluations and significantly improves system performance while maintaining code completion accuracy.

Inventive Principle:
Principle #26Copying

Solution Approach 2:

The system performs code completion analysis in advance and stores the results for future use. By pre-computing completion information and caching it, the system avoids repeated evaluations when multiple source code documents reference the same code modules, thereby improving overall system performance.

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentUS10437574B2System and method for providing code completion features for code modules
Publication Date: 2019.10.08 MICROSOFT TECHNOLOGY LICENSING LLC
  • US10437574B2 patent drawing
  • US10437574B2 patent drawing
  • US10437574B2 patent drawing

AI summary

Systems and methods are described for providing code completion features for code modules that have been incorporated into a source code document being edited by a user of a source code editor. Embodiment dynamically load and apply partial code evaluation to code modules referenced in the source code document (and any code modules referenced directly or indirectly by such code modules) while the user is editing it. The partial code evaluation is performed on a background thread that is separate from a main thread used to execute the user interface for the source code editor. The results of such partial code evaluation are cached and used to provide code completion information for the code modules.