Merge pull request #94 from devchat-ai/ide-service-exception

Add try-catch for some ide services
This commit is contained in:
Tim 2024-04-29 15:11:31 +08:00 committed by GitHub
commit daea79e719
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -86,12 +86,24 @@ class IDEService:
@rpc_method
def get_document_symbols(self, abspath: str) -> List[SymbolNode]:
return [SymbolNode.parse_obj(node) for node in self._result]
try:
return [SymbolNode.parse_obj(node) for node in self._result]
except:
# TODO: loggging ide service error
return []
@rpc_method
def find_type_def_locations(self, abspath: str, line: int, character: int) -> List[Location]:
return [Location.parse_obj(loc) for loc in self._result]
try:
return [Location.parse_obj(loc) for loc in self._result]
except:
# TODO: loggging ide service error
return []
@rpc_method
def find_def_locations(self, abspath: str, line: int, character: int) -> List[Location]:
return [Location.parse_obj(loc) for loc in self._result]
try:
return [Location.parse_obj(loc) for loc in self._result]
except:
# TODO: loggging ide service error
return []