Changeset 5419


Ignore:
Timestamp:
06/20/09 10:13:20 (3 years ago)
Author:
azawawi
Message:

[Perl 6] Implemented all remaining quick fixes except Fix matching =begin/=end POD pairs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Padre-Plugin-Perl6/lib/Padre/Plugin/Perl6/Perl6Document.pm

    r5418 r5419  
    245245                                )), 
    246246                            sub {  
    247                                 #XXX-implement add space before brace 
     247                                #Insert a space before brace 
     248                                my $line_start = $editor->PositionFromLine( $current_line_no ); 
     249                                my $line_end   = $editor->GetLineEndPosition( $current_line_no ); 
     250                                my $line_text  = $editor->GetTextRange($line_start, $line_end); 
     251                                $line_text =~ s/$keyword\(/$keyword \(/; 
     252                                $editor->SetSelection( $line_start, $line_end ); 
     253                                $editor->ReplaceSelection( $line_text ); 
    248254                            }, 
    249255                        ); 
     
    270276                    $menu->Append( -1, Wx::gettext("Use ~ instead of . for string concatenation") ), 
    271277                    sub {  
    272                         #XXX-implement use ~ instead of . for string concatenation 
     278                        #replace first '.' with '~' in the current line 
     279                        my $line_start = $editor->PositionFromLine( $current_line_no ); 
     280                        my $line_end   = $editor->GetLineEndPosition( $current_line_no ); 
     281                        my $line_text  = $editor->GetTextRange($line_start, $line_end); 
     282                        $line_text =~ s/\./~/; 
     283                        $editor->SetSelection( $line_start, $line_end ); 
     284                        $editor->ReplaceSelection( $line_text ); 
    273285                    }, 
    274286                ); 
     
    281293                    $menu->Append( -1, Wx::gettext("Use . instead of -> for method call") ), 
    282294                    sub {  
    283                         #XXX-implement Use . instead of -> for method call 
     295                        #Replace first '->' with '.' in the current line 
     296                        my $line_start = $editor->PositionFromLine( $current_line_no ); 
     297                        my $line_end   = $editor->GetLineEndPosition( $current_line_no ); 
     298                        my $line_text  = $editor->GetTextRange($line_start, $line_end); 
     299                        $line_text =~ s/\-\>/\./; 
     300                        $editor->SetSelection( $line_start, $line_end ); 
     301                        $editor->ReplaceSelection( $line_text ); 
    284302                    }, 
    285303                ); 
     
    292310                    $menu->Append( -1, Wx::gettext("Use Perl 6 constructor syntax") ), 
    293311                    sub {  
    294                         #XXX-implement Use Perl 6 constructor syntax 
     312                        #replace first 'new Foo' with 'Foo.new' in the current line 
     313                         
    295314                    }, 
    296315                ); 
Note: See TracChangeset for help on using the changeset viewer.