Merge pull request #94 from devchat-ai/ide-service-exception
Add try-catch for some ide services
This commit is contained in:
commit
daea79e719
@ -86,12 +86,24 @@ class IDEService:
|
|||||||
|
|
||||||
@rpc_method
|
@rpc_method
|
||||||
def get_document_symbols(self, abspath: str) -> List[SymbolNode]:
|
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
|
@rpc_method
|
||||||
def find_type_def_locations(self, abspath: str, line: int, character: int) -> List[Location]:
|
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
|
@rpc_method
|
||||||
def find_def_locations(self, abspath: str, line: int, character: int) -> List[Location]:
|
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 []
|
||||||
|
Loading…
x
Reference in New Issue
Block a user