If a package has a legitimate Perl error, the client of the package shows "Compilation failed to require", which upon fixing the error is not recovered, unless the client is edited or VS Code session is reloaded.
Take this example:
# File Bar.pm
package Bar;
sub BarFun # error: no open brace
print "hello from Bar::BarFun\n";
}
1;
and, the client:
# File foo.pl
use Bar;
when the code is in this state and VS Code is loaded for the very first time, Perl Language server populates the "Problems" pane with two errors:
Bar.pm (1)
Illegal declaration of subroutine Bar::BarFun at - line 3.
foo.pl (2)
Compilation failed in require at - line 1.
BEGIN failed--compilation aborted at - line 1.
Clicking on the first one conveniently takes us to the problem spot. Apply the fix by adding the brace. And Problem pane updates to showing only foo.pl errors.
Here is the problem: The "Problems" with foo.pl never goes away.
There seems to be only two workarounds:
Edit foo.pl. Remove that exact use line, and add it back.
Reload window.
Neither of these are ideal because, respectively:
Large projects may have 100s of call sites. Problems pane have 100s of "failed in require" errors in 100s of files. They can not all be edited.
Reloading kills any active terminals, and triggers reparsing. Again large projects suffer, terminal and other ephemeral content is lost.
If there is another workaround for this, it would be very helpful. Otherwise, please consider this Issue as a feature request to support updating of clients of a given module when module is changed.
If a package has a legitimate Perl error, the client of the package shows "Compilation failed to require", which upon fixing the error is not recovered, unless the client is edited or VS Code session is reloaded.
Take this example:
and, the client:
when the code is in this state and VS Code is loaded for the very first time, Perl Language server populates the "Problems" pane with two errors:
Clicking on the first one conveniently takes us to the problem spot. Apply the fix by adding the brace. And Problem pane updates to showing only
foo.pl
errors.Here is the problem: The "Problems" with foo.pl never goes away.
There seems to be only two workarounds:
foo.pl
. Remove that exactuse
line, and add it back.Neither of these are ideal because, respectively:
If there is another workaround for this, it would be very helpful. Otherwise, please consider this Issue as a feature request to support updating of clients of a given module when module is changed.
Thanks!