Class PerlLanguageSupport
java.lang.Object
org.fife.rsta.ac.AbstractLanguageSupport
org.fife.rsta.ac.perl.PerlLanguageSupport
- All Implemented Interfaces:
LanguageSupport
Language support for Perl.
- Version:
- 1.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final FileThe root directory of the default Perl install.private PerlParserThe parser.private static FileThe Perl install location currently being used.private PerlCompletionProviderThe completion provider.private static booleanWhether parens should be used around arguments to functions.private static booleanWhether to use the system "perldoc" command for function descriptions.Fields inherited from interface LanguageSupport
PROPERTY_LANGUAGE_PARSER -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ListCellRenderer<Object> Creates the default cell renderer to use when none is specified.static FileReturns the location of the first Perl install located on the user's PATH.private PerlParserReturns the shared parser, lazily creating it if necessary.getParser(org.fife.ui.rsyntaxtextarea.RSyntaxTextArea textArea) Returns the Perl parser running on a text area with this Perl language support installed.Returns the value to use forPERL5LIBwhen parsing Perl code.static FileReturns the Perl install that is being used for syntax checking.private PerlCompletionProviderLazily creates the shared completion provider instance for Perl.booleanReturns whether parens are inserted when auto-completing functions.static booleanReturns whether to use the system "perldoc" command when getting descriptions of Perl functions.booleanReturns whether warnings are enabled when checking syntax.voidinstall(org.fife.ui.rsyntaxtextarea.RSyntaxTextArea textArea) Installs this support.booleanReturns whether text areas with this language support installed are parsed for syntax errors.booleanReturns whether taint mode is enabled when checking syntax.voidsetParsingEnabled(boolean enabled) Toggles whether text areas with this language support installed are parsed for syntax errors.voidsetPerl5LibOverride(String override) Sets the value to use forPERL5LIBwhen parsing Perl code.static voidSets the Perl install to use for syntax checking, perldoc, etc.voidsetTaintModeEnabled(boolean enabled) Toggles whether taint mode is enabled when checking syntax.voidsetUseParensWithFunctions(boolean use) Toggles whether parens are inserted when auto-completing functions.static voidsetUseSystemPerldoc(boolean use) Sets whether to use the system "perldoc" command when getting descriptions of Perl functions.voidsetWarningsEnabled(boolean enabled) Toggles whether warnings are returned when checking syntax.voiduninstall(org.fife.ui.rsyntaxtextarea.RSyntaxTextArea textArea) Uninstalls this support.Methods inherited from class AbstractLanguageSupport
createAutoCompletion, getAutoActivationDelay, getAutoCompletionFor, getDefaultCompletionCellRenderer, getShowDescWindow, getTextAreas, installImpl, isAutoActivationEnabled, isAutoCompleteEnabled, isParameterAssistanceEnabled, setAutoActivationDelay, setAutoActivationEnabled, setAutoCompleteEnabled, setDefaultCompletionCellRenderer, setParameterAssistanceEnabled, setShowDescWindow, uninstallImpl
-
Field Details
-
provider
The completion provider. This is shared amongst all Perl text areas. -
parser
The parser. This is shared amongst all Perl text areas. -
perlInstallLoc
The Perl install location currently being used. -
DEFAULT_PERL_INSTALL_LOC
The root directory of the default Perl install. -
useParensWithFunctions
private static boolean useParensWithFunctionsWhether parens should be used around arguments to functions. -
useSystemPerldoc
private static boolean useSystemPerldocWhether to use the system "perldoc" command for function descriptions. This parameter is ignored ifDEFAULT_PERL_INSTALL_LOCisfalse.
-
-
Constructor Details
-
PerlLanguageSupport
public PerlLanguageSupport()Constructor.
-
-
Method Details
-
createDefaultCompletionCellRenderer
Creates the default cell renderer to use when none is specified. Subclasses can override this method if there is a "better" default renderer for a specific language.- Overrides:
createDefaultCompletionCellRendererin classAbstractLanguageSupport- Returns:
- The default renderer for the completion list.
-
getDefaultPerlInstallLocation
Returns the location of the first Perl install located on the user's PATH.- Returns:
- The "default" location at which Perl is installed.
- See Also:
-
getPerlInstallLocation
Returns the Perl install that is being used for syntax checking.- Returns:
- The location at which Perl is installed, or
nullif none is currently selected. - See Also:
-
getParser
Returns the shared parser, lazily creating it if necessary.- Returns:
- The parser.
-
getParser
Returns the Perl parser running on a text area with this Perl language support installed.- Parameters:
textArea- The text area.- Returns:
- The Perl parser. This will be
nullif the text area does not have this PerlLanguageSupport installed.
-
getProvider
Lazily creates the shared completion provider instance for Perl.- Returns:
- The completion provider.
-
getPerl5LibOverride
Returns the value to use forPERL5LIBwhen parsing Perl code.- Returns:
- The value, or
nullto use the system default. - See Also:
-
getUseParensWithFunctions
public boolean getUseParensWithFunctions()Returns whether parens are inserted when auto-completing functions.- Returns:
- Whether parens are inserted.
- See Also:
-
getUseSystemPerldoc
public static boolean getUseSystemPerldoc()Returns whether to use the system "perldoc" command when getting descriptions of Perl functions. If this isfalse, then a built-in snapshot of Perl 5.10 descriptions will be used. This will perform better, but may be out of date if your version of Perl is newer.Note that this parameter is ignored if
getPerlInstallLocation()returnsnull.- Returns:
- Whether to use the system "perldoc" command.
- See Also:
-
getWarningsEnabled
public boolean getWarningsEnabled()Returns whether warnings are enabled when checking syntax.- Returns:
- Whether warnings are enabled.
- See Also:
-
install
public void install(org.fife.ui.rsyntaxtextarea.RSyntaxTextArea textArea) Description copied from interface:LanguageSupportInstalls this support.- Parameters:
textArea- The text area to install onto.- See Also:
-
isParsingEnabled
public boolean isParsingEnabled()Returns whether text areas with this language support installed are parsed for syntax errors.Note that if
getPerlInstallLocation()returnsnullor an invalid value, parsing will not occur even if this value istrue.- Returns:
- Whether parsing is enabled.
- See Also:
-
isTaintModeEnabled
public boolean isTaintModeEnabled()Returns whether taint mode is enabled when checking syntax.- Returns:
- Whether taint mode is enabled.
- See Also:
-
setParsingEnabled
public void setParsingEnabled(boolean enabled) Toggles whether text areas with this language support installed are parsed for syntax errors.- Parameters:
enabled- Whether parsing should be enabled.- See Also:
-
setPerl5LibOverride
Sets the value to use forPERL5LIBwhen parsing Perl code.- Parameters:
override- The value, ornullto use the system default.- See Also:
-
setPerlInstallLocation
Sets the Perl install to use for syntax checking, perldoc, etc.- Parameters:
loc- The root directory of the Perl installation, ornullfor none.- See Also:
-
setTaintModeEnabled
public void setTaintModeEnabled(boolean enabled) Toggles whether taint mode is enabled when checking syntax.- Parameters:
enabled- Whether taint mode should be enabled.- See Also:
-
setWarningsEnabled
public void setWarningsEnabled(boolean enabled) Toggles whether warnings are returned when checking syntax.- Parameters:
enabled- Whether warnings are enabled.- See Also:
-
setUseParensWithFunctions
public void setUseParensWithFunctions(boolean use) Toggles whether parens are inserted when auto-completing functions.- Parameters:
use- Whether parens are inserted.- See Also:
-
setUseSystemPerldoc
public static void setUseSystemPerldoc(boolean use) Sets whether to use the system "perldoc" command when getting descriptions of Perl functions. If this isfalse, then a built-in snapshot of Perl 5.10 descriptions will be used. This will perform better, but may be out of date if your version of Perl is newer.Note that this parameter is ignored if
getPerlInstallLocation()returnsnull.- Parameters:
use- Whether to use the system "perldoc" command.- See Also:
-
uninstall
public void uninstall(org.fife.ui.rsyntaxtextarea.RSyntaxTextArea textArea) Uninstalls this support.- Parameters:
textArea- The text area to uninstall from.- See Also:
-