MCPcopy Index your code
hub / github.com/FSoft-AI4Code/HyperAgent / _run

Method _run

src/hyperagent/tools/nav_tools.py:124–143  ·  view source on GitHub ↗

Runs the tool to find the definition of a symbol. Args: word (str): The symbol to find the definition of. line (int): The line number of the symbol in the code snippet. relative_path (str): The relative path of the code snippet. verbo

(self, word: str, relative_path: str, line: int = None, verbose: bool = True)

Source from the content-addressed store, hash-verified

122 self.lsptoolkit = LSPToolKit(path, language)
123
124 def _run(self, word: str, relative_path: str, line: int = None, verbose: bool = True):
125 """
126 Runs the tool to find the definition of a symbol.
127
128 Args:
129 word (str): The symbol to find the definition of.
130 line (int): The line number of the symbol in the code snippet.
131 relative_path (str): The relative path of the code snippet.
132 verbose (bool, optional): Whether to display verbose output. Defaults to True.
133
134 Returns:
135 str: The definition of the symbol.
136
137 """
138 if line is not None:
139 line = int(line)
140 try:
141 return self.lsptoolkit.get_definition(word, relative_path, line, verbose=verbose)
142 except:
143 return "File read failed, please check the path again"
144
145class FindAllReferencesArgs(BaseModel):
146 word: str = Field(..., description="The name of the symbol to find all references")

Callers 1

get_all_symbolsFunction · 0.95

Calls 1

get_definitionMethod · 0.80

Tested by

no test coverage detected