NAME

Devel::IntelliPerl - Auto-completion for Perl

SYNOPSIS

use Devel::IntelliPerl;

my $source = <<'SOURCE';
package Foo;

use Moose;

has foobar => ( isa => 'Str', is => 'rw' );

sub bar {
    my $self = shift;
    $self->
}

1;
SOURCE


my $ip = Devel::IntelliPerl->new(source => $source, line_number => 9, column => 12);

my @methods = $ip->methods;

# @methods contains "bar" and "foobar" amongst others

ATTRIBUTES

line

Required

Line number of the cursor. Starts at 1.

column

Required

Position of the cursor. Starts at 0.

source

Required

Source code.

filename

Optional

Store the filename of the current file. This optional. If this value is set @INC is extended by all lib directories, found in any parent directory. This is useful if you want to have access to modules which are not in @INC but in your local lib folder. This method sets "inc".

This value is NOT used to retrive the source code! Use "source" instead.

inc

Optional

All directories specified will be prepended to @INC.

METHODS

keyword

This represents the current keyword.

Examples (cursor is always placed at the end of the line):

my $foo = MyClass-> # keyword is MyClass
my $foo->           # keyword is $foo

prefix

Part of a method which has already been typed.

Examples (cursor is always placed at after ->):

my $foo = MyClass->foo # keyword is MyClass, prefix is foo
my $foo->bar           # keyword is $foo,    prefix is bar

methods

Returns all methods which were found for "keyword".

trimmed_methods

Returns "methods" truncated from the beginning by the length of "prefix".

INTERNAL METHODS

handle_class

Loads the selected class.

handle_self

Loads the current class.

handle_variable

Tries to find the variable's class using regexes. Supported syntaxes:

$variable = MyClass->new
$variable = MyClass->new(...)
$variable = new MyClass
# $variable isa MyClass

inject_statement ($statement)

Injects $statement at the current position.

update_inc

Trigger called by "filename".

TODO

Support for auto completion in the POD (e.g. "[auto complete]" in Devel::IntelliPerl)

AUTHOR

Moritz Onken, <onken at netcubed.de>

BUGS

Please report any bugs or feature requests to bug-devel-intelliperl at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Devel-IntelliPerl. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc Devel::IntelliPerl

You can also look for information at:

COPYRIGHT & LICENSE

Copyright 2009 Moritz Onken, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 314:

You forgot a '=back' before '=head1'