wiki:Features/SyntaxChecking

Version 4 (modified by szabgab, 4 years ago) (diff)

text from Padre.pm

Syntax checking

Depending on a corresponding support in the respective Padre::Document::Language class, Padre supports real time syntax checking capabilities.

Syntax errors or warnings are displayed in a side bar (usually at the bottom of the Padre window). By double-clicking a list entry you can navigate to the position in the file.

Additionally, there is a symbol column on the left side of the editor where colored symbols mark the code lines with problems.

WARNING NOTE

Syntax checking for Perl5 documents comes bundled with Padre. It is implemented using perl -c. This means that parts of the code actually get executed (e.g. BEGIN blocks). Malicious software might used this fact to damage your system

BEGIN { 
   system('rm -rf ~')
}

or suck up your resources

BEGIN { 
   while(1) { } 
}

Syntax checking is currently disabled by default and has to be enabled manually after every start of Padre. This somewhat increases security when doing padre some_unknown_file.pl. However, it does not protect you when you open a file from within Padre while syntax checking is turned on. The most secure solution would require a really fast non-executing syntax checker which unfortunately is currently not available.

Tickets

Ticket Resolution Summary Owner Reporter
#1390 Syntax checking disturbs autocomplete azawawi kaare
#1334 not relevant Syntax checker could be slower ktaragorn
#1314 fixed syntax checker cannot deal with abs_path($0) ? szabgab
#1236 test expects directory Documents in home directory azawawi mmaslano
#1204 not relevant use lib not followed Lady_Aleena
#1203 fixed CGI::Carp qw(fatalsToBrowser) hides errors Lady_Aleena
#1053 strange behavior of syntax check azawawi zenogantner
#911 fixed Syntax check results should be shown by underlining zenogantner
#474 not relevant Syntax checker ignores included dirs Casan
#168 invalid columns in the Syntax check window should keep their size szabgab
#111 fixed continous syntax checking szabgab

Test

TODO