Changeset 7486


Ignore:
Timestamp:
08/23/09 07:09:06 (2 years ago)
Author:
azawawi
Message:

[Padre] Perl 5 'use strict; use warning;' quick fix is brewing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Padre/lib/Padre/QuickFixProvider/Perl.pm

    r7481 r7486  
    2727# 
    2828sub quick_fix_list { 
    29     return (); 
     29    my ($self, $doc, $editor) = @_; 
     30     
     31    my @items = (); 
     32    my $text = $editor->GetText; 
     33    my $current_line_no = $editor->GetCurrentLine; 
     34 
     35    if($text !~ /^\s*use strict/msx) { 
     36        push @items, { 
     37            text => qq{Add 'use strict;'}, 
     38            listener => sub { 
     39                $text = 'use strict;' . $text; 
     40            } 
     41        }; 
     42    } 
     43    if($text !~ /^\s*use warnings/msx) { 
     44        push @items, { 
     45            text => qq{Add 'use warnings;'}, 
     46            listener => sub { 
     47                $text = 'use warnings;' . $text; 
     48                #$editor->ReplaceSelection( 
     49            } 
     50        }; 
     51    } 
     52 
     53    return @items; 
    3054} 
    3155 
     
    4064=head1 DESCRIPTION 
    4165 
    42 Perl 5 quick fix are implemented here 
     66Perl 5 quick fix feature is implemented here 
    4367 
    4468# Copyright 2008-2009 The Padre development team as listed in Padre.pm. 
Note: See TracChangeset for help on using the changeset viewer.