Codebase Search
Learn how to effectively search across multiple repositories in Assembly using powerful regex-based queries
Assembly’s codebase search feature allows you to quickly find and reference code across multiple repositories. This powerful tool uses regex-based queries to provide flexible and precise search capabilities, enhancing your ability to navigate and understand large codebases.
Getting Started with Codebase Search
To use the codebase search in Assembly, you’ll interact with a running server that indexes multiple repositories. Here’s how to get started:
Access the Context Menu
In your Assembly session, switch to the context panel from the upper left corner of any panel.
Enter Your Query
Type your search query into the provided search bar. Remember, every query is treated as a regex pattern.
Review Results
The search results will display matching code snippets, file names, and repository information.
Query Syntax Basics
Understanding the query syntax is key to effective codebase searching. Here are the fundamental concepts:
Advanced Search Techniques
Take your codebase search to the next level with these advanced features:
Symbol Search
Search for symbol definitions (as identified by universal-ctags):
Case Sensitivity
By default, all-lowercase queries are case-insensitive, while queries with any uppercase characters are case-sensitive. Override this behavior with case:
:
Quoted Queries
Use double quotes for queries containing spaces:
Logical Composition
Combine search expressions for more complex queries:
Best Practices for Effective Codebase Search
- Start Broad, Then Refine: Begin with a general search and use filters to narrow down results.
- Use Regex Wisely: Leverage regex patterns for flexible matching, but be cautious of overly complex patterns.
- Combine Filters: Use multiple filters together to pinpoint specific code areas.
- Leverage Symbol Search: For finding function or class definitions quickly.
- Consider Case Sensitivity: Be explicit about case when it matters for your search.
Common Search Scenarios
Here are some example scenarios and how to approach them with codebase search: