Class WorkspaceDiscovery

java.lang.Object
io.github.apexdevtools.apexls.mcp.tools.WorkspaceDiscovery

public class WorkspaceDiscovery extends Object
Utility for discovering Salesforce workspace directories by traversing up the file system to find the nearest sfdx-project.json file.
  • Constructor Details

    • WorkspaceDiscovery

      public WorkspaceDiscovery()
  • Method Details

    • findWorkspace

      public static String findWorkspace(String filePath)
      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

      public static boolean isValidWorkspace(String workspace)
      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