Skip to main content

Definition

Assembly: CloudNimble.ClaudeEssentials.dll Namespace: CloudNimble.ClaudeEssentials.Hooks.Tools.Responses Inheritance: System.Object

Syntax

Summary

Represents a single hunk (contiguous block of changes) in a unified diff patch.

Remarks

A structured patch hunk follows the unified diff format, showing context lines and changed lines together. Each hunk represents changes to a contiguous section of the file. The StructuredPatchHunk.Lines collection uses standard diff prefixes:
  • "-" prefix indicates a line removed from the original
  • "+" prefix indicates a line added in the new version
  • " " (space) prefix indicates an unchanged context line
  • "\" indicates metadata like “No newline at end of file”
Example hunk from an Edit operation:

Constructors

.ctor

Syntax

.ctor Inherited

Inherited from object

Syntax

Properties

Lines

Gets or sets the collection of diff lines representing the changes in this hunk.

Syntax

Property Value

Type: System.Collections.Generic.List<string>

Examples

Remarks

Each line is prefixed with a character indicating its status:
  • "-" - Line was removed from the original file
  • "+" - Line was added in the new file
  • " " - Line is unchanged (context)
  • "\" - Metadata (e.g., ”\ No newline at end of file”)

NewLines

Gets or sets the number of lines in the new file for this hunk.

Syntax

Property Value

Type: int

Remarks

This count includes both added lines (prefixed with "+") and unchanged context lines (prefixed with " ") in the new file.

NewStart

Gets or sets the starting line number in the new file where this hunk begins.

Syntax

Property Value

Type: int

Remarks

Line numbers are 1-based. This indicates where in the modified file the changes represented by this hunk are now located. This may differ from StructuredPatchHunk.OldStart if previous hunks added or removed lines.

OldLines

Gets or sets the number of lines from the original file affected by this hunk.

Syntax

Property Value

Type: int

Remarks

This count includes both removed lines (prefixed with "-") and unchanged context lines (prefixed with " ") from the original file.

OldStart

Gets or sets the starting line number in the original (old) file where this hunk begins.

Syntax

Property Value

Type: int

Remarks

Line numbers are 1-based. This indicates where in the original file the changes represented by this hunk were located.

Methods

Equals Inherited Virtual

Inherited from object

Syntax

Parameters

Returns

Type: bool

Equals Inherited

Inherited from object

Syntax

Parameters

Returns

Type: bool

GetHashCode Inherited Virtual

Inherited from object

Syntax

Returns

Type: int

GetType Inherited

Inherited from object

Syntax

Returns

Type: System.Type

MemberwiseClone Inherited

Inherited from object

Syntax

Returns

Type: object

ReferenceEquals Inherited

Inherited from object

Syntax

Parameters

Returns

Type: bool

ToString Inherited Virtual

Inherited from object

Syntax

Returns

Type: string?