Class WorkspaceDiscovery
java.lang.Object
io.github.apexdevtools.apexls.mcp.tools.WorkspaceDiscovery
Utility for discovering Salesforce workspace directories by traversing up the file system to find
the nearest sfdx-project.json file.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringfindWorkspace(String filePath) Finds the workspace directory containing sfdx-project.json by traversing up from the given file path.static booleanisValidWorkspace(String workspace) Validates that a workspace directory is valid for Apex analysis.
-
Constructor Details
-
WorkspaceDiscovery
public WorkspaceDiscovery()
-
-
Method Details
-
findWorkspace
Finds the workspace directory containing sfdx-project.json by traversing up from the given file path.- Parameters:
filePath- the file path to start searching from- Returns:
- the workspace directory path, or null if no workspace is found
-
isValidWorkspace
Validates that a workspace directory is valid for Apex analysis.- Parameters:
workspace- the workspace path to validate- Returns:
- true if workspace is valid, false otherwise
-