Skip to content

Commit

Permalink
feat: Add new IDE service methods
Browse files Browse the repository at this point in the history
- Implement get_diagnostics_in_range for code diagnostics
- Add get_collapsed_code method for code folding
- Introduce get_extension_tools_path for tool path retrieval
  • Loading branch information
yangbobo2021 committed Jun 26, 2024
1 parent 40f5a61 commit ef47542
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions devchat/ide/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,33 @@ def get_selected_range(self) -> LocationWithText:
if self.ide_name() == "vscode":
return selected_range()
return IdeaIDEService().get_selected_range()

@rpc_method
def get_diagnostics_in_range(self, fileName: str, startLine: int, endLine: int) -> List[str]:
"""
Retrieves diagnostics for a specific range of code in the current IDE.
Returns:
A list of diagnostic messages for the specified range.
"""
return self._result

@rpc_method
def get_collapsed_code(self, fileName: str, startLine: int, endLine: int) -> str:
"""
Retrives collapsed code exclude specfic range of code in the current IDE.
Returns:
The collapsed code.
"""
return self._result

@rpc_method
def get_extension_tools_path(self) -> str:
"""
Retrives extension tools path.
Returns:
The extension tools path.
"""
return self._result

0 comments on commit ef47542

Please sign in to comment.