Skip to content

Commit

Permalink
Merge pull request #6 from apache/fix/WW-5446-jsp-clickable
Browse files Browse the repository at this point in the history
WW-5446 Fixes JSP highlighting and navigating
  • Loading branch information
lukaszlenart authored Aug 21, 2024
2 parents 674d035 + 9d0ca5d commit 60aa6c5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
}

group = "com.intellij"
version = "2024.4.1"
version = "2024.4.2"

repositories {
mavenCentral()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package com.intellij.struts2.dom.inspection;

import com.intellij.codeInspection.options.OptPane;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vfs.VirtualFile;
Expand All @@ -34,6 +35,7 @@
import com.intellij.struts2.dom.struts.impl.path.ResultTypeResolver;
import com.intellij.struts2.dom.struts.model.StrutsManager;
import com.intellij.struts2.dom.struts.strutspackage.ResultType;
import com.intellij.struts2.facet.StrutsFrameworkSupportProvider;
import com.intellij.struts2.facet.ui.StrutsFileSet;
import com.intellij.util.io.URLUtil;
import com.intellij.util.xml.*;
Expand All @@ -55,6 +57,8 @@
*/
public class Struts2ModelInspection extends BasicDomElementsInspection<StrutsRoot> {

private static final Logger LOG = Logger.getInstance(Struts2ModelInspection.class);

/**
* @noinspection PublicField
*/
Expand Down Expand Up @@ -89,6 +93,7 @@ public void checkFileElement(final @NotNull DomFileElement<StrutsRoot> strutsRoo

final Set<StrutsFileSet> fileSets = StrutsManager.getInstance(xmlFile.getProject()).getAllConfigFileSets(module);
for (final StrutsFileSet strutsFileSet : fileSets) {
LOG.info("Checking file set: " + strutsFileSet);
if (strutsFileSet.hasFile(virtualFile)) {
super.checkFileElement(strutsRootDomFileElement, holder);
break;
Expand Down Expand Up @@ -166,6 +171,12 @@ protected boolean shouldCheckResolveProblems(final GenericDomValue value) {
if (URLUtil.containsScheme(stringValue)) {
return false;
}

// WEB-INF/**/*.jsp
if (stringValue.matches("/WEB-INF/*/.*\\.jsp")) {
LOG.info("Inspecting jsp file: " + stringValue);
return false;
}
}

return true;
Expand Down

0 comments on commit 60aa6c5

Please sign in to comment.