ModuleName unresolvedModuleName = ModuleName.maybeMake(moduleNameString);
ModuleName[] moduleNamesInWorkspace = getWorkspaceManager().getWorkspace().getModuleNames();
ModuleNameResolver workspaceModulesResolver = ModuleNameResolver.make(new HashSet<ModuleName>(Arrays.asList(moduleNamesInWorkspace)));
ModuleNameResolver.ResolutionResult workspaceResolution = workspaceModulesResolver.resolve(unresolvedModuleName);
ModuleNameResolver discoverableModulesResolver = ModuleNameResolver.make(getDiscoverableModules());
ModuleName moduleName = resolveModuleName(moduleNameString, discoverableModulesResolver, workspaceResolution.isUnknown(), ":sdm");