Code Assistance Generation Using Context-Aware Grammar Rules
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Current code assistance methods in integrated development environments (IDEs) suffer from low precision and resource wastage due to the display of unnecessary information, which interferes with program developers and reduces development efficiency.
Innovation Solution
A method and device that generate code assistance information by receiving input status information, obtaining a preset grammar rule, and using it to produce relevant assistance based on input content, thereby improving precision and reducing unnecessary information display.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Quantity of substance
If all language element names are displayed as code assistance information, then the completeness of information is improved, but the precision and developer experience deteriorate due to information overload
Solution Approach 1:
The patent extracts only the necessary code assistance information based on the current input context and grammar rules, rather than displaying all language element names. The system analyzes the input statement type (e.g., INSERT, UPDATE, DELETE) and selectively presents relevant information, removing unnecessary information that causes interference to developers.
Solution Approach 2:
The patent applies different information display strategies to different input contexts. Based on the specific statement type and development context, the system provides customized code assistance information tailored to each local situation, rather than using a uniform display approach for all inputs.
2Quantity of substance
If all language element names are displayed as code assistance information, then the completeness of information is improved, but system resource consumption increases due to processing and displaying unnecessary information
Solution Approach 1:
The system extracts and processes only the necessary code assistance information based on the current input context and grammar rules. By filtering out unnecessary information before processing and display, the system reduces computational overhead and resource consumption while maintaining information completeness where needed.
Solution Approach 2:
The patent applies partial action by processing and displaying only the subset of information that is actually needed for the current development context. Rather than processing all language element names, the system performs selective processing based on input analysis, reducing resource consumption while maintaining sufficient information quality.
3Measurement precision
If code assistance information is filtered based on constant input content, then the relevance is improved, but the precision deteriorates because unnecessary information is still included
Solution Approach 1:
The system uses feedback from the input analysis to dynamically adjust the code assistance information. By analyzing the input statement type and context, the system receives feedback about what information is relevant, and continuously refines the displayed information based on this feedback loop, improving both relevance and usefulness.
Solution Approach 2:
The patent changes the parameters of code assistance information based on the input context. Different statement types (INSERT, UPDATE, DELETE) trigger different information parameters to be displayed. The system dynamically adjusts what information is shown by changing parameters according to the specific development context, improving both relevance and usefulness.
Data Source
Figure 1
Figure 2
Figure 3~4
AI summary
A method and a device for generating code assistance information are disclosed. The method includes: obtaining input status information corresponding to a current program development process, where the input status information includes input content information and input language environment information (101); obtaining a preset grammar rule corresponding to the input status information (102), where the preset grammar rule stores an association relationship between different statement information, and different input status information corresponds to different preset grammar rules; and generating code assistance information corresponding to the input content information according to the input content information and the preset grammar rule corresponding to the input status information (103).