Trae's contextual referencing feature provides three levels of code association:
- code block reference: Right click on the selected code and select 'Quote to dialog' and the AI will provide suggestions based on the context of this code
- Document-level references: When you select a file after entering the @ symbol in Chat mode, the entire contents of the file will be used as the background for the analysis.
- Project-level associations: Mark project priorities through the project management panel and AI will prioritize these parts of the analysis
This feature is of significant value in the following scenarios:
- When debugging complex errors, have AI look at both exception code and call stacks
- Maintaining interface consistency between different modules when refactoring large projects
- Quickly understand the logic of code written by others in team collaboration
- Get precise advice when dealing with framework-specific syntax (e.g. React Hooks)
For practical use, it is recommended to state the requirement with a short instruction (e.g. 'Optimize this data processing logic') before attaching relevant code references so that the advice given by the AI will be more targeted.
This answer comes from the articleTrae: a free AI programming tool from ByteHopperThe































