diff --git a/docs/building-with-codegen/codebase-visualization.mdx b/docs/building-with-codegen/codebase-visualization.mdx index aa7575ecf..c08e3b0a4 100644 --- a/docs/building-with-codegen/codebase-visualization.mdx +++ b/docs/building-with-codegen/codebase-visualization.mdx @@ -273,9 +273,3 @@ def create_custom_graph(codebase): - Some graph layouts may take time to compute - Preview features only work when adding symbol objects directly -Remember to: - -1. Use symbol objects (not just names) when you want rich previews -2. Focus visualizations on specific aspects of the codebase -3. Use NetworkX's built-in graph types (DiGraph, Graph) -4. Keep graphs manageable in size for better readability diff --git a/docs/building-with-codegen/dependencies-and-usages.mdx b/docs/building-with-codegen/dependencies-and-usages.mdx index 21ad0f0da..18ea32a46 100644 --- a/docs/building-with-codegen/dependencies-and-usages.mdx +++ b/docs/building-with-codegen/dependencies-and-usages.mdx @@ -7,8 +7,6 @@ iconType: "solid" Codegen pre-computes dependencies and usages for all symbols in the codebase, enabling constant-time queries for these relationships. -This document explains how to use the dependency and usage tracking APIs in Codegen. - ## Overview Codegen provides two main ways to track relationships between symbols: diff --git a/docs/building-with-codegen/files-and-directories.mdx b/docs/building-with-codegen/files-and-directories.mdx index c03eb1674..7ba8fbecd 100644 --- a/docs/building-with-codegen/files-and-directories.mdx +++ b/docs/building-with-codegen/files-and-directories.mdx @@ -15,7 +15,6 @@ Codegen provides three primary abstractions for working with your codebase's fil [SourceFile](/api-reference/core/SourceFile) is a subclass of [File](/api-reference/core/File) that provides additional functionality for source code files. -This guide explains how to effectively use these classes to manage your codebase. ## Accessing Files and Directories diff --git a/docs/building-with-codegen/inheritable-behaviors.mdx b/docs/building-with-codegen/inheritable-behaviors.mdx index f13a64dcc..74eb2386d 100644 --- a/docs/building-with-codegen/inheritable-behaviors.mdx +++ b/docs/building-with-codegen/inheritable-behaviors.mdx @@ -7,7 +7,6 @@ iconType: "solid" Codegen uses a set of core behaviors that can be inherited by code elements. These behaviors provide consistent APIs across different types of symbols. -This guide explains the key behaviors and how to use them effectively. ## Core Behaviors diff --git a/docs/building-with-codegen/the-editable-api.mdx b/docs/building-with-codegen/the-editable-api.mdx index 37236c430..8eab4b04f 100644 --- a/docs/building-with-codegen/the-editable-api.mdx +++ b/docs/building-with-codegen/the-editable-api.mdx @@ -168,10 +168,3 @@ for var in function.code_block.get_local_var_assignments(): print(f"Warning: {var.name} defined in try block") ``` -## Best Practices - -1. **Use High-Level Operations**: Prefer operations like `rename()` over direct source editing when possible. -2. **Leverage Search**: Use the built-in search capabilities rather than parsing text manually. -3. **Work with Extended Sources**: Use `extended_source` when you need to modify decorators or comments together with the code. -4. **Mind the Context**: Remember that each Editable knows its location and relationships in the code. -5. **Trust the Formatting**: Let Codegen handle whitespace and syntax details automatically. diff --git a/docs/building-with-codegen/variable-assignments.mdx b/docs/building-with-codegen/variable-assignments.mdx index 87567e8ed..1dfc17df7 100644 --- a/docs/building-with-codegen/variable-assignments.mdx +++ b/docs/building-with-codegen/variable-assignments.mdx @@ -10,7 +10,6 @@ Codegen's enables manipulation of variable assignments via the following classes - [AssignmentStatement](../api-reference/core/AssignmentStatement) - A statement containing one or more assignments - [Assignment](../api-reference/core/Assignment) - A single assignment within an AssignmentStatement -This document provides examples of how to manipulate assignments using these APIs ### Simple Value Changes diff --git a/docs/introduction/community.mdx b/docs/introduction/community.mdx index 06592b392..ed02a4276 100644 --- a/docs/introduction/community.mdx +++ b/docs/introduction/community.mdx @@ -40,7 +40,7 @@ Join the growing Codegen community! We're excited to have you be part of our jou We welcome contributions of all kinds! Whether you're fixing a typo in documentation, reporting a bug, or implementing a new feature, we appreciate your help in making Codegen better. -Check out our [Contributing Guide](https://github.com/codegen-sh/codegen-sdk/blob/main/CONTRIBUTING.md) on GitHub to learn how to: +Check out our [Contributing Guide](https://github.com/codegen-sh/codegen-sdk/blob/develop/CONTRIBUTING.md) on GitHub to learn how to: - Set up your development environment - Submit pull requests diff --git a/docs/tutorials/increase-type-coverage.mdx b/docs/tutorials/increase-type-coverage.mdx index 5c8579971..53c7785f1 100644 --- a/docs/tutorials/increase-type-coverage.mdx +++ b/docs/tutorials/increase-type-coverage.mdx @@ -31,7 +31,7 @@ Each of these has an associated setter. ## Finding the extent of your type coverage -T to get an indication of your progress on type coverage, analyze the percentage of typed elements across your codebase +To get an indication of your progress on type coverage, analyze the percentage of typed elements across your codebase ```python # Initialize counters for parameters diff --git a/docs/tutorials/react-modernization.mdx b/docs/tutorials/react-modernization.mdx index 0843d6d58..a4036cbea 100644 --- a/docs/tutorials/react-modernization.mdx +++ b/docs/tutorials/react-modernization.mdx @@ -320,16 +320,3 @@ components/ code](/building-with-codegen/moving-symbols) here. -## Best Practices - -1. **Test Thoroughly**: React modernization can affect component behavior. Test each conversion carefully. - -2. **Incremental Updates**: Convert components gradually, especially in large codebases. - -3. **Update Dependencies**: Ensure your package.json has the required dependencies for modern React features. - -4. **TypeScript Migration**: Consider using this opportunity to add TypeScript support to your components. - -5. **Documentation**: Update component documentation to reflect the new functional patterns. - -By following these guidelines, you can effectively modernize your React codebase while maintaining functionality and improving maintainability. diff --git a/docs/tutorials/training-data.mdx b/docs/tutorials/training-data.mdx index ced20867f..038aab5d8 100644 --- a/docs/tutorials/training-data.mdx +++ b/docs/tutorials/training-data.mdx @@ -200,36 +200,3 @@ def create_training_example(function_data): examples = [create_training_example(f) for f in training_data["functions"]] ``` -## Best Practices - -1. **Filter Small Functions**: Skip trivial functions that won't provide meaningful training data: -```python -if len(function.source.split("\n")) < 2: - continue -``` - -2. **Ensure Sufficient Context**: Only use functions with dependencies or usages: -```python -if len(context["dependencies"]) + len(context["usages"]) > 0: - training_data["functions"].append(context) -``` - -3. **Track Metadata**: Keep statistics about your training data: -```python -training_data["metadata"] = { - "total_functions": len(codebase.functions), - "total_processed": len(training_data["functions"]), - "avg_dependencies": average_dependencies, - "avg_usages": average_usages -} -``` - -4. **Handle Import Chains**: Follow import chains to find root implementations: -```python -def hop_through_imports(imp: Import) -> Symbol | ExternalModule: - if isinstance(imp.imported_symbol, Import): - return hop_through_imports(imp.imported_symbol) - return imp.imported_symbol -``` - -By following these guidelines, you can generate high-quality training data for your LLM projects while maintaining code quality and consistency. \ No newline at end of file