|
| 1 | +{ |
| 2 | + "$defs": { |
| 3 | + "DefinitionRequest": { |
| 4 | + "description": "Finds the definition, declaration, or type definition of a symbol.\n\nUse this to jump to the actual source code where a symbol is defined,\nits declaration site, or the definition of its type/class.", |
| 5 | + "properties": { |
| 6 | + "locate": { |
| 7 | + "$ref": "#/$defs/Locate" |
| 8 | + }, |
| 9 | + "mode": { |
| 10 | + "default": "definition", |
| 11 | + "enum": [ |
| 12 | + "definition", |
| 13 | + "declaration", |
| 14 | + "type_definition" |
| 15 | + ], |
| 16 | + "title": "Mode", |
| 17 | + "type": "string" |
| 18 | + } |
| 19 | + }, |
| 20 | + "required": [ |
| 21 | + "locate" |
| 22 | + ], |
| 23 | + "title": "DefinitionRequest", |
| 24 | + "type": "object" |
| 25 | + }, |
| 26 | + "LineScope": { |
| 27 | + "description": "Scope by line range", |
| 28 | + "properties": { |
| 29 | + "line": { |
| 30 | + "anyOf": [ |
| 31 | + { |
| 32 | + "type": "integer" |
| 33 | + }, |
| 34 | + { |
| 35 | + "maxItems": 2, |
| 36 | + "minItems": 2, |
| 37 | + "prefixItems": [ |
| 38 | + { |
| 39 | + "type": "integer" |
| 40 | + }, |
| 41 | + { |
| 42 | + "type": "integer" |
| 43 | + } |
| 44 | + ], |
| 45 | + "type": "array" |
| 46 | + } |
| 47 | + ], |
| 48 | + "title": "Line" |
| 49 | + } |
| 50 | + }, |
| 51 | + "required": [ |
| 52 | + "line" |
| 53 | + ], |
| 54 | + "title": "LineScope", |
| 55 | + "type": "object" |
| 56 | + }, |
| 57 | + "Locate": { |
| 58 | + "description": "Two-stage location: scope \u2192 find.\n\nResolution rules:\n 1. SymbolScope without find: symbol declaration position (for references, rename)\n 2. With find containing marker: marker position\n 3. With find only: start of matched text\n 4. No scope + find: search entire file\n\nMarker Detection:\n The marker is automatically detected using nested bracket notation:\n - <|> (single level)\n - <<|>> (double level) if <|> appears more than once\n ... and so on\n\n The marker with the deepest nesting level that appears exactly once\n is chosen as the position marker.\n\nExamples:\n # Symbol declaration\n Locate(file_path=\"foo.py\", scope=SymbolScope(symbol_path=[\"MyClass\"]))\n\n # Completion trigger point - basic marker\n Locate(file_path=\"foo.py\", find=\"self.<|>\")\n\n # When <|> exists in source, use deeper nesting\n Locate(file_path=\"foo.py\", find=\"x = <|> + y <<|>> z\")\n # Will use <<|>> as the position marker\n\n # Specific location in function\n Locate(\n file_path=\"foo.py\",\n scope=SymbolScope(symbol_path=[\"process\"]),\n find=\"return <|>result\"\n )", |
| 59 | + "properties": { |
| 60 | + "file_path": { |
| 61 | + "format": "path", |
| 62 | + "title": "File Path", |
| 63 | + "type": "string" |
| 64 | + }, |
| 65 | + "scope": { |
| 66 | + "anyOf": [ |
| 67 | + { |
| 68 | + "$ref": "#/$defs/LineScope" |
| 69 | + }, |
| 70 | + { |
| 71 | + "$ref": "#/$defs/SymbolScope" |
| 72 | + }, |
| 73 | + { |
| 74 | + "type": "null" |
| 75 | + } |
| 76 | + ], |
| 77 | + "default": null, |
| 78 | + "title": "Scope" |
| 79 | + }, |
| 80 | + "find": { |
| 81 | + "anyOf": [ |
| 82 | + { |
| 83 | + "type": "string" |
| 84 | + }, |
| 85 | + { |
| 86 | + "type": "null" |
| 87 | + } |
| 88 | + ], |
| 89 | + "default": null, |
| 90 | + "title": "Find" |
| 91 | + } |
| 92 | + }, |
| 93 | + "required": [ |
| 94 | + "file_path" |
| 95 | + ], |
| 96 | + "title": "Locate", |
| 97 | + "type": "object" |
| 98 | + }, |
| 99 | + "Position": { |
| 100 | + "description": "Represents a specific position in a file using line and character numbers.\n\nNote: Line and character are 1-based indices. 0-based indices are used in LSP, so conversion is needed when interfacing with LSP.", |
| 101 | + "properties": { |
| 102 | + "line": { |
| 103 | + "minimum": 1, |
| 104 | + "title": "Line", |
| 105 | + "type": "integer" |
| 106 | + }, |
| 107 | + "character": { |
| 108 | + "minimum": 1, |
| 109 | + "title": "Character", |
| 110 | + "type": "integer" |
| 111 | + } |
| 112 | + }, |
| 113 | + "required": [ |
| 114 | + "line", |
| 115 | + "character" |
| 116 | + ], |
| 117 | + "title": "Position", |
| 118 | + "type": "object" |
| 119 | + }, |
| 120 | + "Range": { |
| 121 | + "properties": { |
| 122 | + "start": { |
| 123 | + "$ref": "#/$defs/Position" |
| 124 | + }, |
| 125 | + "end": { |
| 126 | + "$ref": "#/$defs/Position" |
| 127 | + } |
| 128 | + }, |
| 129 | + "required": [ |
| 130 | + "start", |
| 131 | + "end" |
| 132 | + ], |
| 133 | + "title": "Range", |
| 134 | + "type": "object" |
| 135 | + }, |
| 136 | + "SymbolCodeInfo": { |
| 137 | + "properties": { |
| 138 | + "file_path": { |
| 139 | + "format": "path", |
| 140 | + "title": "File Path", |
| 141 | + "type": "string" |
| 142 | + }, |
| 143 | + "name": { |
| 144 | + "title": "Name", |
| 145 | + "type": "string" |
| 146 | + }, |
| 147 | + "path": { |
| 148 | + "items": { |
| 149 | + "type": "string" |
| 150 | + }, |
| 151 | + "title": "Path", |
| 152 | + "type": "array" |
| 153 | + }, |
| 154 | + "kind": { |
| 155 | + "$ref": "#/$defs/SymbolKind" |
| 156 | + }, |
| 157 | + "range": { |
| 158 | + "anyOf": [ |
| 159 | + { |
| 160 | + "$ref": "#/$defs/Range" |
| 161 | + }, |
| 162 | + { |
| 163 | + "type": "null" |
| 164 | + } |
| 165 | + ], |
| 166 | + "default": null |
| 167 | + }, |
| 168 | + "code": { |
| 169 | + "anyOf": [ |
| 170 | + { |
| 171 | + "type": "string" |
| 172 | + }, |
| 173 | + { |
| 174 | + "type": "null" |
| 175 | + } |
| 176 | + ], |
| 177 | + "default": null, |
| 178 | + "title": "Code" |
| 179 | + } |
| 180 | + }, |
| 181 | + "required": [ |
| 182 | + "file_path", |
| 183 | + "name", |
| 184 | + "path", |
| 185 | + "kind" |
| 186 | + ], |
| 187 | + "title": "SymbolCodeInfo", |
| 188 | + "type": "object" |
| 189 | + }, |
| 190 | + "SymbolKind": { |
| 191 | + "enum": [ |
| 192 | + "file", |
| 193 | + "module", |
| 194 | + "namespace", |
| 195 | + "package", |
| 196 | + "class", |
| 197 | + "method", |
| 198 | + "property", |
| 199 | + "field", |
| 200 | + "constructor", |
| 201 | + "enum", |
| 202 | + "interface", |
| 203 | + "function", |
| 204 | + "variable", |
| 205 | + "constant", |
| 206 | + "string", |
| 207 | + "number", |
| 208 | + "boolean", |
| 209 | + "array", |
| 210 | + "object", |
| 211 | + "key", |
| 212 | + "null", |
| 213 | + "enumMember", |
| 214 | + "struct", |
| 215 | + "event", |
| 216 | + "operator", |
| 217 | + "typeParameter" |
| 218 | + ], |
| 219 | + "title": "SymbolKind", |
| 220 | + "type": "string" |
| 221 | + }, |
| 222 | + "SymbolScope": { |
| 223 | + "description": "Scope by symbol, also serves as declaration locator when find is omitted", |
| 224 | + "properties": { |
| 225 | + "symbol_path": { |
| 226 | + "items": { |
| 227 | + "type": "string" |
| 228 | + }, |
| 229 | + "title": "Symbol Path", |
| 230 | + "type": "array" |
| 231 | + } |
| 232 | + }, |
| 233 | + "required": [ |
| 234 | + "symbol_path" |
| 235 | + ], |
| 236 | + "title": "SymbolScope", |
| 237 | + "type": "object" |
| 238 | + } |
| 239 | + }, |
| 240 | + "markdown": "\n# {{ request.mode | replace: \"_\", \" \" | capitalize }} Result\n\n{% if items.size == 0 -%}\nNo {{ request.mode | replace: \"_\", \" \" }} found.\n{%- else -%}\n{%- for item in items -%}\n## `{{ item.file_path }}`: {{ item.path | join: \".\" }} (`{{ item.kind }}`)\n\n{% if item.code != nil -%}\n### Content\n```{{ item.file_path.suffix | remove_first: \".\" }}\n{{ item.code }}\n```\n{%- endif %}\n\n{% endfor -%}\n{%- endif %}\n", |
| 241 | + "properties": { |
| 242 | + "request": { |
| 243 | + "$ref": "#/$defs/DefinitionRequest" |
| 244 | + }, |
| 245 | + "items": { |
| 246 | + "items": { |
| 247 | + "$ref": "#/$defs/SymbolCodeInfo" |
| 248 | + }, |
| 249 | + "title": "Items", |
| 250 | + "type": "array" |
| 251 | + } |
| 252 | + }, |
| 253 | + "required": [ |
| 254 | + "request", |
| 255 | + "items" |
| 256 | + ], |
| 257 | + "title": "DefinitionResponse", |
| 258 | + "type": "object" |
| 259 | +} |
0 commit comments