![JAR search and dependency download from the Maven repository](/logo.png)
org.fife.rsta.ac.perl.PerlLanguageSupport Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of languagesupport Show documentation
Show all versions of languagesupport Show documentation
A library adding code completion and other advanced features for Java, JavaScript, Perl, and other languages to RSyntaxTextArea.
The newest version!
/*
* 03/21/2010
*
* Copyright (C) 2010 Robert Futrell
* robert_futrell at users.sourceforge.net
* http://fifesoft.com/rsyntaxtextarea
*
* This library is distributed under a modified BSD license. See the included
* RSTALanguageSupport.License.txt file for details.
*/
package org.fife.rsta.ac.perl;
import java.io.File;
import javax.swing.ListCellRenderer;
import org.fife.rsta.ac.AbstractLanguageSupport;
import org.fife.rsta.ac.IOUtil;
import org.fife.ui.autocomplete.AutoCompletion;
import org.fife.ui.autocomplete.CompletionCellRenderer;
import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea;
/**
* Language support for Perl.
*
* @author Robert Futrell
* @version 1.0
*/
public class PerlLanguageSupport extends AbstractLanguageSupport {
/**
* The completion provider. This is shared amongst all Perl text areas.
*/
private PerlCompletionProvider provider;
/**
* The parser. This is shared amongst all Perl text areas.
*/
private PerlParser parser;
/**
* The Perl install location currently being used.
*/
private static File perlInstallLoc;
/**
* The root directory of the default Perl install.
*/
private static final File DEFAULT_PERL_INSTALL_LOC;
/**
* Whether parens should be used around arguments to functions.
*/
private static boolean useParensWithFunctions;
/**
* Whether to use the system "perldoc" command for function descriptions.
* This parameter is ignored if {@link #DEFAULT_PERL_INSTALL_LOC} is
* false
.
*/
private static boolean useSystemPerldoc;
/*
* Determine the Perl install on the user's PATH, if any.
*/
static {
String path = IOUtil.getEnvSafely("PATH");
if (path!=null) {
String perlLoc = "perl";
if (File.separatorChar=='\\') {
perlLoc += ".exe";
}
String[] dirs = path.split(File.pathSeparator);
for (String dir : dirs) {
File temp = new File(dir, perlLoc);
//System.out.println(temp.getAbsolutePath());
if (temp.isFile()) {
perlInstallLoc = new File(dir).getParentFile();
break;
}
}
}
DEFAULT_PERL_INSTALL_LOC = perlInstallLoc;
}
/**
* Constructor.
*/
public PerlLanguageSupport() {
setParameterAssistanceEnabled(true);
setShowDescWindow(true);
}
/**
* {@inheritDoc}
*/
@Override
protected ListCellRenderer
© 2015 - 2025 Weber Informatics LLC | Privacy Policy