Interface ApexLsBridge
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
EmbeddedApexLsBridge
Bridge interface for communicating between the Java 17 MCP server and the Java 8 apex-ls core
functionality.
This abstraction allows for different bridge implementations: - Embedded classpath-based bridge (same JVM) - Process-based bridge (separate JVM) - Future: Network-based bridge
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Shutdown the bridge and release resources.findUsages(String workspaceDirectory, String filePath, int line, int offset) Find usages of an identifier at a specific position.getDefinition(String workspaceDirectory, String filePath, int line, int offset) Get definition location for an identifier at a specific position.Get static analysis issues for a workspace.getTestClassItemsChanged(String workspaceDirectory, String[] changedPaths) Find test classes that should be run based on changes to specific source files.Get version information from apex-ls core.getWorkspaceInfo(String workspaceDirectory) Get workspace information and metadata.voidInitialize the bridge and establish connection to apex-ls core.booleanisReady()Check if the bridge is ready for operations.
-
Method Details
-
initialize
Initialize the bridge and establish connection to apex-ls core.- Throws:
Exception- if bridge initialization fails
-
isReady
boolean isReady()Check if the bridge is ready for operations.- Returns:
- true if bridge is connected and ready
-
getIssues
CompletableFuture<String> getIssues(String workspaceDirectory, boolean includeWarnings, int maxIssuesPerFile) Get static analysis issues for a workspace.- Parameters:
workspaceDirectory- path to workspaceincludeWarnings- include warning-level issuesmaxIssuesPerFile- maximum number of issues to return per file- Returns:
- future containing issues in JSON format
-
findUsages
CompletableFuture<String> findUsages(String workspaceDirectory, String filePath, int line, int offset) Find usages of an identifier at a specific position.- Parameters:
workspaceDirectory- path to workspacefilePath- path to fileline- line number (0-based)offset- character offset within line- Returns:
- future containing usages in JSON format
-
getDefinition
CompletableFuture<String> getDefinition(String workspaceDirectory, String filePath, int line, int offset) Get definition location for an identifier at a specific position.- Parameters:
workspaceDirectory- path to workspacefilePath- path to fileline- line number (0-based)offset- character offset within line- Returns:
- future containing definition location in JSON format
-
getWorkspaceInfo
Get workspace information and metadata.- Parameters:
workspaceDirectory- path to workspace- Returns:
- future containing workspace info in JSON format
-
getVersion
CompletableFuture<String> getVersion()Get version information from apex-ls core.- Returns:
- future containing version string
-
getTestClassItemsChanged
CompletableFuture<String> getTestClassItemsChanged(String workspaceDirectory, String[] changedPaths) Find test classes that should be run based on changes to specific source files.- Parameters:
workspaceDirectory- path to workspacechangedPaths- array of file paths that have been changed- Returns:
- future containing impacted test classes in JSON format
-
close
Shutdown the bridge and release resources.- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-