Closed izogfif closed 3 years ago
Ugh, that's probably because I'm looking for the converter class in the project of the psi file to convert (https://github.com/casid/jte-intellij/blob/571dad30c2d81436c066f0d6a83be43c9d85941d/src/main/java/org/jusecase/jte/intellij/language/convert/JteConvertFromJspAction.java#L37).
PsiFile psiFile = e.getData(LangDataKeys.PSI_FILE);
if (psiFile == null) {
return;
}
Project project = psiFile.getProject();
PsiClass converterBaseClass = JavaPsiFacade.getInstance(project).findClass(CONVERTER_BASE_CLASS, GlobalSearchScope.everythingScope(project));
I'll have a look if I can search in the module of that file instead.
I transferred this issue over to the jte-intellij plugin.
And I think I have a fix for it. It now works with multiple modules in my dummy project.
I'll try to release a new version of the plugin this weekend.
I've uploaded a new version of the plugin!
Thank you for submitting a 1.4.1 version of jte plugin, it has been successfully uploaded to the plugins repository and now pending JetBrains' review and approval in order to be publicly available.
All new updates are normally reviewed within two business days. You will receive a notification as soon as status of this review changes.
@casid can you add a tag and release for 1.4.1 version of this plugin? So that it can be downloaded from https://github.com/casid/jte-intellij/releases page. "Two business days" means that it won't be available from Intellij IDEA plugin marketplace until at least Tuesday. Update: the plugin was approved in Intellij IDEA marketplace. Great. Still, I think that it should also be placed in https://github.com/casid/jte-intellij/releases page. For consistency.
@casid I've installed the plugin and I'm getting this error message now:
Could not locate class 'gg.jte.convert.jsp.JspToJteConverter' on the classpath. You're probably missing the jte-jsp-converter dependency.
I've even changed scope from test
to compile
and added code
JspToJteConverter g = new JspToJteConverter(Path.of("/"), Path.of("/"), "");
in one of .java files inside src/main/java
of the module. The project compiled successfully, i.e. the issue is not that I forgot to add a dependency.
After studying your commit, I think I found the issue. Method com.intellij.psi.search.GlobalSearchScope.moduleScope
has this JavaDoc:
Returns module scope including sources and tests, excluding libraries and dependencies.
Maybe you should use GlobalSearchScope.moduleWithDependenciesAndLibrariesScope
instead?
Update: I've changed all occurrences of moduleScope
in plugin code to moduleWithDependenciesAndLibrariesScope
(I found two of them), built it, installed into IDEA, restarted IDEA, then ran "Code->Convert JSP to jte file" command again. Now it works the way it is supposed to.
Thanks for the investigation. I released a hotfix version of the plugin.
I have a multi-module Maven project. I created
Module1JspToJteConverter
that extendsJspToJteConverter
inmodule1
. Converted.tag
file insidemodule1
using Intellij IDEA plugin. Everything was fine. Then I createdModule2JspToJteConverter
inmodule2
. It has different settings (e.g.converter.setPrefix
contains different list of@import
directives). When I open in Intellij IDEA.tag
file that resides insidemodule2
and go to menuCode->Convert JSP file to jte file
,Module1JspToJteConverter
starts instead ofModule2JspToJteConverter
.