LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • Agent
  • Middleware
  • Backends
  • Sandboxes
  • Skills
  • Subagents
  • Types
Modal
Daytona
Deno
Node VFS
Sandbox Standard Tests
  • Vitest
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

OverviewAgentMiddlewareBackendsSandboxesSkillsSubagentsTypes
Modal
Daytona
Deno
Node VFS
Sandbox Standard Tests
Vitest
Language
Theme
JavaScriptdeepagentsbackendsformatContentWithLineNumbersAndBoundaries
Function●Since v1.13

formatContentWithLineNumbersAndBoundaries

Format file content with line numbers and structured source-line boundaries.

The boundaries let downstream size limiting truncate only after complete source lines without reparsing the rendered gutter. This keeps presentation details (padding, tab separators, and continuation labels) encapsulated in the formatter that creates them.

Copy
formatContentWithLineNumbersAndBoundaries(
  content: string | string[],
  startLine: number = 1
): FormattedContentWithLineNumbers

Parameters

NameTypeDescription
content*string | string[]
startLinenumber
Default:1
View source on GitHub