Skip to content

Commit 344285d

Browse files
committed
update: sync docs/schemas with src/lsap_schema
1 parent bd340e5 commit 344285d

File tree

15 files changed

+479
-357
lines changed

15 files changed

+479
-357
lines changed

docs/schemas/completion.md

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,12 @@ The Completion API (IntelliSense) provides context-aware code suggestions at a s
44

55
## CompletionRequest
66

7-
| Field | Type | Default | Description |
8-
| :-------------- | :------------------------------------------------------- | :------- | :------------------------------------------ |
9-
| `locate` | [`LocateText`](locate.md) \| [`LocateSymbol`](locate.md) | Required | Where to trigger the completion. |
10-
| `max_items` | `number \| null` | `15` | Maximum number of suggestions to return. |
11-
| `start_index` | `number` | `0` | Number of items to skip. |
12-
| `pagination_id` | `string \| null` | `null` | Token to retrieve the next page of results. |
13-
14-
> [!TIP]
15-
> To trigger completion after a dot (e.g., `user.`), use [`LocateText`](locate.md) with `find="user."` and `find_end="end"`.
7+
| Field | Type | Default | Description |
8+
| :-------------- | :------------------------ | :------- | :------------------------------------------ |
9+
| `locate` | [`Locate`](locate.md) | Required | Where to trigger the completion. |
10+
| `max_items` | `number \| null` | `15` | Maximum number of suggestions to return. |
11+
| `start_index` | `number` | `0` | Number of items to skip. |
12+
| `pagination_id` | `string \| null` | `null` | Token to retrieve the next page of results. |
1613

1714
## CompletionResponse
1815

@@ -33,6 +30,7 @@ The Completion API (IntelliSense) provides context-aware code suggestions at a s
3330
| `kind` | `string` | Type (Method, Property, Class, etc.). |
3431
| `detail` | `string?` | Short info like signature or type. |
3532
| `documentation` | `string?` | Full markdown documentation for the item. |
33+
| `insert_text` | `string?` | The actual snippet that would be inserted.|
3634

3735
## Example Usage
3836

@@ -44,9 +42,7 @@ The Completion API (IntelliSense) provides context-aware code suggestions at a s
4442
{
4543
"locate": {
4644
"file_path": "src/main.py",
47-
"line": 15,
48-
"find": "client.",
49-
"find_end": "end"
45+
"find": "client."
5046
},
5147
"max_items": 5
5248
}
@@ -70,6 +66,11 @@ Establishes a connection to the server using the configured credentials. Returns
7066

7167
---
7268

69+
> [!TIP]
70+
> More results available. Use `start_index` to fetch more.
71+
72+
---
73+
7374
> [!TIP]
7475
> Use these symbols to construct your next code edit. You can focus on a specific method to get more details.
7576
```
@@ -82,9 +83,7 @@ Establishes a connection to the server using the configured credentials. Returns
8283
{
8384
"locate": {
8485
"file_path": "src/api.py",
85-
"line": 42,
86-
"find": "response.",
87-
"find_end": "end"
86+
"find": "response."
8887
},
8988
"max_items": 10,
9089
"start_index": 0
@@ -116,6 +115,11 @@ Returns the response body parsed as JSON. Raises JSONDecodeError if invalid.
116115

117116
> [!TIP]
118117
> Use `pagination_id="abc123"` to fetch more suggestions.
118+
119+
---
120+
121+
> [!TIP]
122+
> Use these symbols to construct your next code edit. You can focus on a specific method to get more details.
119123
```
120124

121125
### Scenario 3: No completion suggestions available
@@ -126,9 +130,7 @@ Returns the response body parsed as JSON. Raises JSONDecodeError if invalid.
126130
{
127131
"locate": {
128132
"file_path": "src/main.py",
129-
"line": 100,
130-
"find": "unknown_var.",
131-
"find_end": "end"
133+
"find": "unknown_var."
132134
}
133135
}
134136
```

docs/schemas/diagnostics.md

Lines changed: 0 additions & 110 deletions
This file was deleted.
Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ The Call Hierarchy API allows tracing the relationships between functions, showi
44

55
## CallHierarchyRequest
66

7-
| Field | Type | Default | Description |
8-
| :----------------- | :------------------------------------------------------- | :------- | :--------------------------------------------------- |
9-
| `locate` | [`LocateText`](locate.md) \| [`LocateSymbol`](locate.md) | Required | The symbol to trace callers/callees for. |
10-
| `direction` | `"incoming" \| "outgoing" \| "both"` | `"both"` | Direction of the trace. |
11-
| `depth` | `number` | `2` | Maximum number of hops to trace. |
12-
| `include_external` | `boolean` | `false` | Whether to include calls to/from external libraries. |
7+
| Field | Type | Default | Description |
8+
| :----------------- | :-------------------------- | :-------- | :--------------------------------------------------- |
9+
| `locate` | [`Locate`](locate.md) | Required | The symbol to trace callers/callees for. |
10+
| `direction` | `"incoming"` \| `"outgoing"` \| `"both"` | `"both"` | Direction of the trace. |
11+
| `depth` | `number` | `2` | Maximum number of hops to trace. |
12+
| `include_external` | `boolean` | `false` | Whether to include calls to/from external libraries. |
1313

1414
## CallHierarchyResponse
1515

@@ -19,6 +19,10 @@ The Call Hierarchy API allows tracing the relationships between functions, showi
1919
| `nodes` | `Map<string, CallHierarchyNode>` | Details of all types encountered in the hierarchy. |
2020
| `edges_in` | `Map<string, CallEdge[]>` | Incoming edges for each node. |
2121
| `edges_out` | `Map<string, CallEdge[]>` | Outgoing edges for each node. |
22+
| `calls_in` | `CallHierarchyItem[]` | Flat list of incoming calls for tree rendering. |
23+
| `calls_out` | `CallHierarchyItem[]` | Flat list of outgoing calls for tree rendering. |
24+
| `direction` | `string` | The direction that was used. |
25+
| `depth` | `number` | The depth that was used. |
2226

2327
### CallHierarchyNode
2428

@@ -30,6 +34,16 @@ The Call Hierarchy API allows tracing the relationships between functions, showi
3034
| `file_path` | `string` | Relative path to the file. |
3135
| `range_start` | `Position` | Start coordinates of the definition. |
3236

37+
### CallHierarchyItem
38+
39+
| Field | Type | Description |
40+
| :---------- | :--------- | :----------------------------------------------------- |
41+
| `name` | `string` | Name of the function. |
42+
| `kind` | `string` | Symbol kind (e.g., `Function`, `Method`). |
43+
| `file_path` | `string` | Relative path to the file. |
44+
| `level` | `number` | Nesting level in the hierarchy. |
45+
| `is_cycle` | `boolean` | Whether this represents a recursive cycle. |
46+
3347
### CallEdge
3448

3549
| Field | Type | Description |
@@ -48,7 +62,9 @@ The Call Hierarchy API allows tracing the relationships between functions, showi
4862
{
4963
"locate": {
5064
"file_path": "src/app.py",
51-
"symbol_path": ["start_server"]
65+
"scope": {
66+
"symbol_path": ["start_server"]
67+
}
5268
},
5369
"direction": "outgoing",
5470
"depth": 1
@@ -79,7 +95,9 @@ The Call Hierarchy API allows tracing the relationships between functions, showi
7995
{
8096
"locate": {
8197
"file_path": "src/db.py",
82-
"symbol_path": ["initialize_db"]
98+
"scope": {
99+
"symbol_path": ["initialize_db"]
100+
}
83101
},
84102
"direction": "incoming",
85103
"depth": 2
@@ -110,7 +128,9 @@ The Call Hierarchy API allows tracing the relationships between functions, showi
110128
{
111129
"locate": {
112130
"file_path": "src/controllers.py",
113-
"symbol_path": ["handle_request"]
131+
"scope": {
132+
"symbol_path": ["handle_request"]
133+
}
114134
},
115135
"direction": "both",
116136
"depth": 3,

0 commit comments

Comments
 (0)