Camelcade / Perl5-IDEA

Perl5 plugins for IntelliJ IDEA
https://plugins.jetbrains.com/plugin/7796-perl/
Other
406 stars 75 forks source link

_Deparsed_Xsubs.pm created in submodule #2642

Open Zastai opened 1 year ago

Zastai commented 1 year ago

IDE: IntelliJ IDEA 2022.3.3 (Ultimate Edition) - Build #IU-223.8836.41, built on March 10, 2023 Plugin: 2022.3.3 JRE: Runtime version: 17.0.6+1-b653.34 amd64

The xsubs file used to be at the top of my project tree, but it is now getting placed in the folder for the alphabetically-first module.

I have a Java project in C:\foo. There is a project-name module with C:\Foo as content root (so the whole tree is visible in the IDE). The perl plugin is only involved because the project also includes a single perl script that is used to generate some Java code; that script is in the project-name module.

Actual code lives under substructures like src/component/main/java, where each component has its own module. There are multiple such module, including build-tasks and core. Each has its src/component folder as content root; so the core module has C:\foo\src\core as content root.

Given that there is one module whose content root is a parent of the content roots of all other modules, it would make sense for the deparsed xsubs to be placed there. However, it is now ending up in the root of the build-tasks module; that's not even a standalone module - it depends on core. I am guessing it's getting picked because it's first in the module list (an order I have no control over).

I can manually move it to the top, but that then has an extra step where it asks me how to clear the file's read-only status (using file system or otherwise).

Why does this file even need to be inside the project tree at all? It certainly feels like it would be better placed under .idea/perl5 somewhere (possibly with separate files for project, libs and system). If it does have to be there, why not make the specific module or folder configurable?

(I'm probably only noticing this now because of a fresh branch checkout; my existing project trees all had it at the top already so it would always have been used/updated there.)

hurricup commented 1 year ago

This was recently changed in #2548

You may manually move deparsed file in any content root or project/root and it will be-recreated in the same place. First time plugin uses first content root it was able to create file in. But using topmost root sounds reasonable.