Result (@NotNull String line, int entireLength) { int start = line.indexOf("["); if (start == -1) return null; int end = line.indexOf(']', start + 1); if (end == -1) return null; String moduleNameCandidate = line.substring(start + 1, end); boolean isTests = moduleNameCandidate.startsWith(TESTS_PREFIX); String moduleName = isTests ? moduleNameCandidate.substring(TESTS_PREFIX.length()) : moduleNameCandidate; int lineStart = entireLength - line.length(); return new Result(lineStart + start + 1 + (isTests ? TESTS_PREFIX.length() : 0), lineStart + end, new HyperlinkInfo() { @Override public void navigate(@NotNull Project project) { if (project.isDisposed()) return; Module module = ModuleManager.getInstance(myProject).findModuleByName(moduleName); if (module == null || module.isDisposed()) return; ProjectSettingsService.getInstance(myProject).openContentEntriesSettings(module); } }); }