Open temporaryhamper opened 6 years ago
And where is use MyModule
in the myscript.pl
? :)
That's what I expect auto import to add. Much like what IDEs do for Java. I expect to type the name of a subroutine in a file and to see the module it's defined in to automatically be imported.
Type hello_world
and that should trigger use MyModule qw(hello_world);
(or at least use MyModule
) to be added to the top of the file.
Additional detail, in case it's relevant:
IdeaVim plugin 0.48
Oh now I see. I thought it's about not resovled imported sub. No, there is no such feature yet.
But if You'll add use
manually, it should work.
Found with:
IntelliJ IDEA 2017.2.6 Build #IU-172.4574.11
Perl5 plugin 2017.3.2
Perl 5.18.4
Java 1.8.0_152-b16
macOS Sierra 10.12.6
Steps to reproduce:
Perl5 module
lib
as the package namesrc
as the package namelib
and selectPerl5 libraries
lib
in the Project tools windowMyModule
as the file namePackage
kindsrc
in the Project tools windowmyscript
as the file nameScript
kindAdd the following contents to
MyModule.pm
and save:Add the following contents to
myscript.pl
:Expected results:
hello_world
,use MyModule;
oruse MyModule qw(hello_world);
is automatically added to the top of the file, or a pop-up appears suggesting the name of a module to importActual results:
hello_world
, a tooltip says:Check if sub has been defined, declared or aliased with a typeglob.