@@ -151,12 +151,43 @@ def __hash__(self) -> int:
151151 return hash ((self .kind , self .name , self .identifier_position , self .range ))
152152
153153
154+ class Identifier (BaseModel ):
155+ """Representation of an identifier in code."""
156+
157+ name : str = Field (..., description = "The name of the identifier." )
158+ range : FileRange = Field (
159+ ..., description = "The range of the identifier in the file."
160+ )
161+
162+
163+ class FindIdentifierRequest (BaseModel ):
164+ """Request to find all occurrences of an identifier by name in a file."""
165+
166+ name : str = Field (..., description = "The name of the identifier to search for." )
167+ path : str = Field (
168+ ..., description = "The path to the file to search for identifiers."
169+ )
170+ position : Optional [Position ] = Field (
171+ None ,
172+ description = "The position hint to search for identifiers. If provided, returns exact match or closest matches." ,
173+ )
174+
175+
176+ class IdentifierResponse (BaseModel ):
177+ """Response containing found identifiers."""
178+
179+ identifiers : List [Identifier ] = Field (..., description = "List of found identifiers." )
180+
181+
154182class DefinitionResponse (BaseModel ):
155183 """Response containing definition locations of a symbol."""
156184
157185 definitions : List [FilePosition ] = Field (
158186 ..., description = "List of definition locations for the symbol."
159187 )
188+ selected_identifier : Optional [Identifier ] = Field (
189+ None , description = 'The identifier that was "clicked-on" to get the definition.'
190+ )
160191 raw_response : Optional [Union [dict , list ]] = Field (
161192 None ,
162193 description = (
@@ -192,6 +223,9 @@ class ReferencesResponse(BaseModel):
192223 references : List [FilePosition ] = Field (
193224 ..., description = "List of reference locations for the symbol."
194225 )
226+ selected_identifier : Optional [Identifier ] = Field (
227+ None , description = 'The identifier that was "clicked-on" to get the references.'
228+ )
195229 context : Optional [List [CodeContext ]] = Field (
196230 None , description = "Source code contexts around the references."
197231 )
0 commit comments