Skip to content

Commit a899e69

Browse files
committed
Update encoding documentation
1 parent 334783d commit a899e69

4 files changed

Lines changed: 22 additions & 18 deletions

File tree

docs/API.md

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,17 @@ Analyze file structure with semantic outline and search hints.
2222
**Signature:**
2323
```python
2424
def get_overview(
25-
absolute_file_path: str,
26-
encoding: str = "utf-8"
25+
absolute_file_path: str
2726
) -> FileOverview
2827
```
2928

3029
**Parameters:**
3130
- `absolute_file_path`: Absolute path to the file (required)
32-
- `encoding`: File encoding (default: "utf-8")
3331

3432
**Returns:** `FileOverview` object with:
3533
- `line_count`: Total lines in file
3634
- `file_size`: File size in bytes
37-
- `encoding`: Detected or specified encoding
35+
- `encoding`: Auto-detected file encoding
3836
- `has_long_lines`: True if any line exceeds 1000 characters
3937
- `outline`: Hierarchical structure via Tree-sitter (if supported)
4038
- `search_hints`: Suggested search patterns for exploration
@@ -58,8 +56,7 @@ def search_content(
5856
pattern: str,
5957
max_results: int = 20,
6058
context_lines: int = 2,
61-
fuzzy: bool = True,
62-
encoding: str = "utf-8"
59+
fuzzy: bool = True
6360
) -> List[SearchResult]
6461
```
6562

@@ -69,7 +66,6 @@ def search_content(
6966
- `max_results`: Maximum number of results to return (default: 20)
7067
- `context_lines`: Number of context lines before/after match (default: 2)
7168
- `fuzzy`: Enable fuzzy matching with similarity scoring (default: True)
72-
- `encoding`: File encoding (default: "utf-8")
7369

7470
**Returns:** List of `SearchResult` objects with:
7571
- `line_number`: Line where match was found
@@ -100,16 +96,14 @@ Read targeted content by line number or pattern with semantic chunking.
10096
def read_content(
10197
absolute_file_path: str,
10298
target: Union[int, str],
103-
mode: str = "lines",
104-
encoding: str = "utf-8"
99+
mode: str = "lines"
105100
) -> str
106101
```
107102

108103
**Parameters:**
109104
- `absolute_file_path`: Absolute path to the file (required)
110105
- `target`: Line number (int) or search pattern (str) to locate content (required)
111106
- `mode`: Reading mode - "lines", "semantic", or "function" (default: "lines")
112-
- `encoding`: File encoding (default: "utf-8")
113107

114108
**Reading Modes:**
115109
- `"lines"`: Read specific line number or lines around pattern match
@@ -141,8 +135,7 @@ def edit_content(
141135
search_text: str,
142136
replace_text: str,
143137
fuzzy: bool = True,
144-
preview: bool = True,
145-
encoding: str = "utf-8"
138+
preview: bool = True
146139
) -> EditResult
147140
```
148141

@@ -152,7 +145,6 @@ def edit_content(
152145
- `replace_text`: Replacement text (required)
153146
- `fuzzy`: Enable fuzzy matching for search_text (default: True)
154147
- `preview`: Show preview without making changes (default: True)
155-
- `encoding`: File encoding (default: "utf-8")
156148

157149
**Returns:** `EditResult` object with:
158150
- `success`: True if operation succeeded

docs/design.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ def edit_content(
186186
class FileOverview:
187187
line_count: int
188188
file_size: int
189-
encoding: str
189+
encoding: str # Auto-detected file encoding
190190
has_long_lines: bool # >1000 chars (triggers truncation)
191191
outline: List[OutlineItem] # Hierarchical via Tree-sitter
192192
search_hints: List[str] # Common patterns for exploration
@@ -281,7 +281,7 @@ src/
281281

282282
## Scope
283283

284-
**In**: UTF-8 text files, **search/replace editing**, fuzzy pattern matching, semantic structure, hierarchical navigation
284+
**In**: Text files (auto-detected encoding), **search/replace editing**, fuzzy pattern matching, semantic structure, hierarchical navigation
285285
**Out**: Binary files, multi-file ops, collaboration, version control, **line-based editing**
286286

287287
## LLM Usage Patterns

docs/plans/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# plans
2+
3+
The docs/plans directory contains design docs and implementation plans.
4+
5+
All documents in this directory are temporary and are deleted when features land in the main codebase. If referencing these docs, please use their Github Permalinks.

docs/plans/encoding.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,16 @@
7373

7474
#### Phase 5: Documentation and testing
7575

76-
- [ ] Update API.md, design.md, examples
77-
- [ ] Add encoding detection tests
78-
- [ ] Test various encodings and edge cases
76+
- [x] Update API.md, design.md, examples
77+
- [x] Add encoding detection tests
78+
- [x] Test various encodings and edge cases
79+
80+
**Implementation Notes:**
81+
- API.md updated to remove all encoding parameters from tool signatures
82+
- design.md updated to reflect auto-detected encoding support
83+
- examples.md already clean (no encoding parameters used)
84+
- **Existing tests comprehensive**: UTF-8, Latin-1, UTF-16, empty files, non-existent files
85+
- **ASCII detection fix**: ASCII files now default to UTF-8 for better compatibility
7986

8087
#### Phase 6: Quality assurance
8188

0 commit comments

Comments
 (0)