MCPcopy Create free account
hub / github.com/Zoo-Code-Org/Zoo-Code / getRootResolutionStrategy

Function getRootResolutionStrategy

src/utils/path.ts:141–150  ·  view source on GitHub ↗

* Read the `zoo-code.workspace.rootResolution` setting safely. * * Wrapped in try/catch because: * 1. `vscode.workspace.getConfiguration` is unavailable in some test/CLI * execution contexts. * 2. The path utilities are imported very early during extension activation, * so we mus

()

Source from the content-addressed store, hash-verified

139 * so we must never throw from a config read.
140 */
141function getRootResolutionStrategy(): WorkspaceRootResolution {
142 try {
143 const value = vscode.workspace
144 .getConfiguration(Package.name)
145 .get<string>("workspace.rootResolution", DEFAULT_ROOT_RESOLUTION)
146 return value === "firstFolder" ? "firstFolder" : DEFAULT_ROOT_RESOLUTION
147 } catch {
148 return DEFAULT_ROOT_RESOLUTION
149 }
150}
151
152export const getWorkspacePath = (defaultCwdPath = "") => {
153 const firstFolderPath =

Callers 2

getWorkspacePathFunction · 0.85

Calls 2

getMethod · 0.65
getConfigurationMethod · 0.65

Tested by

no test coverage detected