Edit Automation Using Anchor Target Lists for Code Refactoring

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current source code editors face challenges in making precise and complex edits, such as renaming or refactoring, especially in large codebases, due to limitations in string search and replace functionality, and users often lack awareness or access to advanced editing tools like regular expressions or refactoring functionalities.

Innovation Solution

The implementation of edit automation functionalities, including anchor target lists, temporal edit patterns, and transform providers, which allow for automated identification and application of edits across similar code locations, staying within the user's current workflow and providing recommendations or applying changes without diverting from the editing process.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If string search and replace functionality is used for precise edits in large codebases, then basic editing capability is maintained, but editing precision and reliability deteriorate due to inability to handle complex patterns and lack of awareness of advanced tools

Engineering Contradiction:
Improveediting precisionVSAvoidaccessibility of advanced tools
Core Design Contradiction:
Measurement precisionVSEase of operation

Solution Approach 1:

The system automatically detects when a user performs a search and replace operation and proactively offers relevant advanced tools (regex patterns, refactoring functionalities) without requiring users to know about or search for these tools themselves. The editor serves itself by identifying opportunities to assist and presenting contextually appropriate advanced capabilities.

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

The system provides feedback to users by analyzing their editing behavior and offering suggestions for improved editing approaches. When users perform basic search and replace, the system feedbacks information about more precise tools available, creating a loop that gradually introduces users to advanced functionalities while improving editing precision.

Inventive Principle:
Principle #23Feedback

2Measurement precision

If advanced editing tools like regular expressions and refactoring functionalities are made accessible, then editing precision improves, but device complexity increases due to additional features and functionalities

Engineering Contradiction:
Improveediting precisionVSAvoideditor complexity
Core Design Contradiction:
Measurement precisionVSDevice complexity

Solution Approach 1:

The system prepares and pre-configures advanced editing tools and patterns in advance, so that when users need precise editing, the tools are already ready and contextualized. Regex patterns and refactoring options are pre-processed and presented in user-friendly formats, reducing the apparent complexity while maintaining precision capabilities.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The system acts as an intermediary between users and complex editing functionalities. Instead of exposing raw regex syntax or complex refactoring parameters directly, the system translates user intent into appropriate advanced operations, mediating the interaction to simplify the interface while preserving powerful capabilities.

Inventive Principle:
Principle #24Intermediary (Mediator)

3Productivity

If automated edit functionalities are implemented to make edits across similar code locations, then productivity improves, but the risk of applying incorrect transforms increases

Engineering Contradiction:
Improveediting efficiencyVSAvoidcode integrity
Core Design Contradiction:
ProductivityVSReliability

Solution Approach 1:

The system applies transforms progressively and partially, offering recommendations for automated edits rather than applying them all at once. Users can review and selectively accept or reject individual transforms, allowing partial application of changes. This reduces the risk of widespread errors while maintaining productivity benefits for accepted changes.

Inventive Principle:
Principle #16Partial or excessive action

Solution Approach 2:

The system performs preliminary analysis and validation of proposed transforms before application, identifying potential issues and preventing harmful changes. By anticipating problems and implementing safeguards in advance, the system counteracts potential code breakage while enabling efficient automated editing for safe transformations.

Inventive Principle:
Principle #9Preliminary anti-action

Data Source

PatentUS11941372B2Edit automation using an anchor target list
Publication Date: 2024.03.26 MICROSOFT TECHNOLOGY LICENSING LLC
  • US11941372B2 patent drawing
  • US11941372B2 patent drawing
  • US11941372B2 patent drawing

AI summary

Edit automation functionality generalizes edits performed by a user in a document, locates similar text, and recommends or applies transforms while staying within a current workflow. Source code edits such as refactoring are automated. The functionality uses or provides anchor target lists, temporal edit patterns, edit graphs, automatable edit sequence libraries, and other data structures and computational techniques for identifying locations appropriate for particular edits, for getting transforms, for selecting optimal transforms, for leveraging transforms in an editing session or later, and for displaying transform recommendations and results. The edit automation functionality enhances automation subtool generation, discoverability, and flexibility, for refactoring, snippet insertion, quick actions in an integrated development environment, and other automatable edit sequences.