In Line with Context: Repository-Level Code Generation via Context Inlining
Chao Hu, Wenhao Zeng, Yuling Shi, Beijun Shen, Xiaodong Gu

TL;DR
InlineCoder is a novel framework that improves repository-level code generation by inline-contextualizing functions within call graphs, enabling better understanding of complex dependencies.
Contribution
It introduces a new inlining-based approach that enhances repository understanding for code generation, surpassing surface-level similarity methods.
Findings
Enables more accurate repository-level code generation.
Uses inlining to incorporate upstream and downstream context.
Provides a confidence estimate for generated code.
Abstract
Repository-level code generation has attracted growing attention in recent years. Unlike function-level code generation, it requires the model to understand the entire repository, reasoning over complex dependencies across functions, classes, and modules. However, existing approaches such as retrieval-augmented generation (RAG) or context-based function selection often fall short: they primarily rely on surface-level similarity and struggle to capture the rich dependencies that govern repository-level semantics. In this paper, we introduce InlineCoder, a novel framework for repository-level code generation. InlineCoder enhances the understanding of repository context by inlining the unfinished function into its call graph, thereby reframing the challenging repository understanding as an easier function-level coding task. Given a function signature, InlineCoder first generates a draft…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
