Skip to content

Commit

Permalink
fix: Qute template validation breaks when using Gradle
Browse files Browse the repository at this point in the history
Fixes #1237

Signed-off-by: azerr <azerr@redhat.com>
  • Loading branch information
angelozerr committed Oct 18, 2023
1 parent a1a9b8a commit b2a9210
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import com.redhat.devtools.intellij.qute.psi.internal.QuteJavaConstants;
import com.redhat.qute.commons.ProjectInfo;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jps.model.java.JavaResourceRootType;

import java.util.Collections;
import java.util.HashSet;
Expand Down Expand Up @@ -60,6 +61,10 @@ public static ProjectInfo getProjectInfo(Module javaProject) {
}

private static String getTemplateBaseDir(Module javaProject) {
List<VirtualFile> resourcesDirs = ModuleRootManager.getInstance(javaProject).getSourceRoots(JavaResourceRootType.RESOURCE);
if (!resourcesDirs.isEmpty()) {
return LSPIJUtils.toUri(resourcesDirs.get(0)).resolve("templates").toASCIIString();
}
return LSPIJUtils.toUri(javaProject).resolve(TEMPLATES_BASE_DIR).toASCIIString();
}

Expand Down

0 comments on commit b2a9210

Please sign in to comment.