| 99 | { |
| 100 | public: |
| 101 | UnknownWorkspace(std::string_view workspace, |
| 102 | const std::vector<std::string>& allWorkspaces, DebugInfo info) |
| 103 | : Exception("UnknownWorkspace", info) |
| 104 | { |
| 105 | this->error("Impossible to get Workspace '{}', please check it is correctly " |
| 106 | "indexed", workspace); |
| 107 | std::vector<std::string> suggestions |
| 108 | = Utils::String::sortByDistance(workspace.data(), allWorkspaces, 5); |
| 109 | std::transform(suggestions.begin(), suggestions.end(), suggestions.begin(), |
| 110 | Utils::String::quote); |
| 111 | this->hint("Maybe you meant to get one of these workspaces : ({})", |
| 112 | fmt::join(suggestions, ", ")); |
| 113 | } |
| 114 | }; |
| 115 | } |