Giter VIP home page Giter VIP logo

rstalanguagesupport's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rstalanguagesupport's Issues

JavaScript auto complete enhancement

First I would like to thank you for the efforts that have gone into this project. I am integrating RSyntaxTextArea and the Language support projects into a data integration framework. It uses the Rhino engine for scripting data transformations and other purposes. I have spent the last couple of weeks getting to know the code and would like to offer an update for JavaScript auto complete with useBeanproperties = true. I discovered that it would only auto complete Java variables if they were declared using a fully qualified class name. I tried both importClass and importPackage but an unqualified name is not recognized.

I made the following changes to get the qualified name from the JarManager when a new TypeDeclaration is created:

Modified Class: org.fife.rsta.ac.java.JarManager

changed: private List classFileSources;
to: private static List classFileSources;

added method: getQualifiedName(String name)

/**
* Gets the fully qualified name for a class if it can be located
* in one of the jars on the build path.
* @param name the class name to locate.
* @return String fully qualified class name or the name if the class
* could not be located.
*/
public static String getQualifiedName(String name) {
String lowerCaseText = name.toLowerCase();
for (int i=0; i < classFileSources.size(); i++) {
JarReader jar = (JarReader) classFileSources.get(i);
List classFiles = jar.getClassesWithNamesStartingWith(lowerCaseText);
if (classFiles!=null) {
for (Iterator j=classFiles.iterator(); j.hasNext(); ) {
ClassFile cf = (ClassFile)j.next();
if (cf.getClassName(false).equals(name))
return cf.getClassName(true);
}
}
}
return name;
}

Modified Class: org.fife.rsta.ac.js.JavaScriptHelper
Modified Method: createNewTypeDeclaration(String newName) as follows:

public static TypeDeclaration createNewTypeDeclaration(String newName) { // create a new Type // added code if (newName.indexOf(".") == -1) { newName = JarManager.getQualifiedName(newName); } // end of added code
   String pName = newName.indexOf('.') > 0 ? newName.substring(0,
               newName.lastIndexOf('.')) : "";
   String cName = newName.indexOf('.') > 0 ? newName.substring(
               newName.lastIndexOf('.') + 1, newName.length())
               : newName;
   return new TypeDeclaration(pName, cName, newName);
}

The following now works as expected:

importPackage(com.virtualplex.dbparams); // contains DataSetParam

var dataSetParam = new DataSetParam(dataSetName, tableSchema, tableName);
dataSetParam. <<< the auto complete dialog popups when '.' is entered.

The only potential issue I can see with this is the static modifier on classFileSources, which could be an issue if there are multiple instances of the editor running in a VM and they require different jars on the build path. In my case, there can be multiple instances but the same jars are loaded in all cases.

Again, awesome project and thanks,
Gary

Code Completion for Objects in javascript rhino

Th code completion works fine for objects created in java, but it does't work for objects created in script itself.
for example for the following object created in script its x and y properties (even methods) are not populated in code completion window.
var m={x:12,y:13}

How can I implement this?

Another exception in JavaScriptOutlineTree

When opening gtp/.tmp/concat/js/dw.min.js in RText:

java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.fife.rtext.plugins.sourcebrowser.SourceBrowserPlugin$1.run(SourceBrowserPlugin.java:237)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:694)
at java.awt.EventQueue$3.run(EventQueue.java:692)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:703)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
Caused by: java.lang.NullPointerException
at org.fife.rsta.ac.js.tree.JavaScriptOutlineTreeGenerator.addPrototypeAdditionsToRoot(JavaScriptOutlineTreeGenerator.java:80)
at org.fife.rsta.ac.js.tree.JavaScriptOutlineTreeGenerator.getTreeRoot(JavaScriptOutlineTreeGenerator.java:152)
at org.fife.rsta.ac.js.tree.JavaScriptOutlineTree.update(JavaScriptOutlineTree.java:236)
at org.fife.rsta.ac.js.tree.JavaScriptOutlineTree.checkForJavaScriptParsing(JavaScriptOutlineTree.java:116)
at org.fife.rsta.ac.js.tree.JavaScriptOutlineTree.listenTo(JavaScriptOutlineTree.java:201)
at org.fife.rtext.plugins.langsupport.JavaScriptSourceBrowserTreeConstructor.constructSourceBrowserTree(JavaScriptSourceBrowserTreeConstructor.java:45)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.fife.rtext.plugins.sourcebrowser.SourceBrowserPlugin$1.run(SourceBrowserPlugin.java:237)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:694)
at java.awt.EventQueue$3.run(EventQueue.java:692)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:703)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)

Message to stdout when java.net.URI is selected in code completion window

Unmatched linkContent: <a href="http://www.ietf.org/rfc/rfc2279.txt"><i>RFC&nbsp;2279: UTF-8, a transformation format of ISO 10646</i></a>, <br><a href="http://www.ietf.org/rfc/rfc2373.txt"><i>RFC&nbsp;2373: IPv6 Addressing Architecture</i></a>, <br><a href="http://www.ietf.org/rfc/rfc2396.txt"><i>RFC&nbsp;2396: Uniform Resource Identifiers (URI): Generic Syntax</i></a>, <br><a href="http://www.ietf.org/rfc/rfc2732.txt"><i>RFC&nbsp;2732: Format for Literal IPv6 Addresses in URLs</i></a>, <br><a href="URISyntaxException.html">URISyntaxException</a>

Auto complete for Java >=9 jdk classes

Is it possible to add Java's >=9 jdk classes to autocomplete?

The method JarManager.addCurrentJreClassFileSource() doesn't work with Java >= 9, it look just for rt.jar and src.zip, which is absent since Java 9. Actual method is LibraryInfo.getJreJarInfo(File jreHome)

Usage examples for org.fife.rsta.ac.java.SourceCompletionProvider or JavaCompletionProvider.

Hello,

I'm very interested in putting your library to use in my project. However, I've had no luck getting anything other than basic completions to work. Do you have example usages available to demonstrate, for instance, completion of import statements (I imagine everything in the basic Java API would be completable)?

When I'm interested in Java completion, should I primarily be working with org.fife.rsta.ac.java.JavaCompletionProvider, or with org.fife.rsta.ac.java.SourceCompletionProvider?

Many thanks in advance.

Using scala results in heavy stdout ,,Unsupported class attribute'' output that freeze everything

Using rsyntaxtextarea with scala results in many many messanges to stdout like this:

Unsupported class attribute: ScalaInlineInfo
Unsupported class attribute: ScalaSig

Looks like this is not really error and can be ignored:

System.out.println("Unsupported class attribute: "+ attrName);

Unfortunately, it takes 30-50 seconds to print all the messages with scala 2.11 core libs + spark and freeze the UI.

What about replacing this with debugPrint ?

JavaScript: JSX

Since it's my first comment on github: Very nice set of components!! Thank you.

Is it too much effort to ask for JSX support?

kind regards

How to get javadoc working??

How can we show javadoc for javascript default functions as well as for external jar.
The code completion works for external jar but javadocs are not shown even when jar contains source also.
Any idea how can I get javadocs working?

Allow ASTFactory to throw IOException

Hello. We're trying to add RSTALanguageSupport to scripting in ImageJ and are running into the problem that if there is a syntax error in Java, you get the cool error highlighting but also print a stacktrace.

This is because ASTFactory is catching the IOException and printing it before it gets to the JavaParser which, as desired, doesn't print the stack trace.

So it seems like maybe ASTFactory shouldn't be handling the exceptions, but allow the parsers to do so instead..? Or maybe it's sufficient to just not print the stack trace at the ASTFactory level.

Code hint?

1
2

How to achieve the code prompt effect in Figure 1
I found that php does not provide code prompts when using Demo

Exception in JavaOutlineTree

java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.fife.rtext.plugins.sourcebrowser.SourceBrowserPlugin$1.run(SourceBrowserPlugin.java:237)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:694)
at java.awt.EventQueue$3.run(EventQueue.java:692)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:703)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
Caused by: java.lang.ExceptionInInitializerError
at org.fife.rsta.ac.java.tree.JavaTreeNode.(JavaTreeNode.java:66)
at org.fife.rsta.ac.java.tree.JavaTreeNode.(JavaTreeNode.java:59)
at org.fife.rsta.ac.java.tree.JavaOutlineTree.update(JavaOutlineTree.java:109)
at org.fife.rsta.ac.java.tree.JavaOutlineTree.checkForJavaParsing(JavaOutlineTree.java:180)
at org.fife.rsta.ac.java.tree.JavaOutlineTree.listenTo(JavaOutlineTree.java:332)
at org.fife.rtext.plugins.langsupport.JavaSourceBrowserTreeConstructor.constructSourceBrowserTree(JavaSourceBrowserTreeConstructor.java:45)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.fife.rtext.plugins.sourcebrowser.SourceBrowserPlugin$1.run(SourceBrowserPlugin.java:237)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:694)
at java.awt.EventQueue$3.run(EventQueue.java:692)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:703)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
Caused by: java.lang.IllegalArgumentException: icon not found: img/jcu_obj.gif
at org.fife.rsta.ac.java.IconFactory.loadIcon(IconFactory.java:152)
at org.fife.rsta.ac.java.IconFactory.(IconFactory.java:71)
at org.fife.rsta.ac.java.IconFactory.(IconFactory.java:65)
at org.fife.rsta.ac.java.tree.JavaTreeNode.(JavaTreeNode.java:66)
at org.fife.rsta.ac.java.tree.JavaTreeNode.(JavaTreeNode.java:59)
at org.fife.rsta.ac.java.tree.JavaOutlineTree.update(JavaOutlineTree.java:109)
at org.fife.rsta.ac.java.tree.JavaOutlineTree.checkForJavaParsing(JavaOutlineTree.java:180)
at org.fife.rsta.ac.java.tree.JavaOutlineTree.listenTo(JavaOutlineTree.java:332)
at org.fife.rtext.plugins.langsupport.JavaSourceBrowserTreeConstructor.constructSourceBrowserTree(JavaSourceBrowserTreeConstructor.java:45)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.fife.rtext.plugins.sourcebrowser.SourceBrowserPlugin$1.run(SourceBrowserPlugin.java:237)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:694)
at java.awt.EventQueue$3.run(EventQueue.java:692)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:703)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)

Possible bug in org.fife.rsta.ac.java.classreader.MethodInfo.java

Hello,

it seems there is a bug in getReturnTypeString(boolean fullyQualified) method. When method is called first with fullyQualified = false the global returnType variable is initialized by not qualified type name and then not updated. In next call unqualified name is returned.

Here is my code to fix it:

/**
 * Returns the return type of this method.
 *
 * @return The return type of this method.
 */
public String getReturnTypeString(boolean fullyQualified) {
        String returnType0;
	if (returnType==null) {
		returnType0 = getReturnTypeStringFromTypeSignature(fullyQualified);
		if (returnType0==null) {
			returnType0 = getReturnTypeStringFromDescriptor(fullyQualified);
		}
	} else {
                returnType0 = returnType;
            }
	if(!fullyQualified)
	{
		if(returnType0 != null && returnType0.indexOf(".") > -1) {
			return returnType0.substring(returnType0.lastIndexOf(".") +1, returnType0.length());  
		}
	} else {
                returnType = returnType0;
            }
	return returnType;
}

JavaScript: Support simple jquery code completion

Add a switch to JavaScriptLanguageSupport to toggle very simple jquery code completion. Even something as simple as typing:

 $('something').

could trigger available JQuery functions after the standard delay.

Hard crash due to bug in JavaParser

To reproduce:

  1. Run the DemoApp
  2. In the menu, select "Language > Java"
  3. As the last statement of a method body, enter Set<D and wait a second or so
  4. The application crashes

Stacktrace:

ERROR: Token being duplicated: [TokenImpl: type=8388612; lexeme="}"; line=48; col=4; offs=1211; invalid=false]
java.lang.Exception: Stack trace
	at java.base/java.lang.Thread.dumpStack(Thread.java:1388)
	at org.fife.rsta.ac.java.rjc.lexer.Scanner.pushOntoStack(Scanner.java:105)
	at org.fife.rsta.ac.java.rjc.lexer.Scanner.yyPeek(Scanner.java:706)
	at org.fife.rsta.ac.java.rjc.parser.ASTFactory._getMemberDecl(ASTFactory.java:1084)
	at org.fife.rsta.ac.java.rjc.parser.ASTFactory._getClassBody(ASTFactory.java:405)
	at org.fife.rsta.ac.java.rjc.parser.ASTFactory._getNormalClassDeclaration(ASTFactory.java:1178)
	at org.fife.rsta.ac.java.rjc.parser.ASTFactory._getClassOrInterfaceDeclaration(ASTFactory.java:447)
	at org.fife.rsta.ac.java.rjc.parser.ASTFactory._getTypeDeclaration(ASTFactory.java:1451)
	at org.fife.rsta.ac.java.rjc.parser.ASTFactory.getCompilationUnit(ASTFactory.java:591)
	at org.fife.rsta.ac.java.JavaParser.parse(JavaParser.java:143)
	at org.fife.ui.rsyntaxtextarea.ParserManager.actionPerformed(ParserManager.java:163)
	at java.desktop/javax.swing.Timer.fireActionPerformed(Timer.java:317)
	at java.desktop/javax.swing.Timer$DoPostEvent.run(Timer.java:249)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:740)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

This is due to a call to System.exit in a sanity check done in pushOntoStack. JavaParser uses a stack for lookaheads etc. and one of the peek methods (yylex) apparently fails to properly pop a token in some cases, leaving the token on the stack. Then, when re-pushing it, they realise that the token is already on the stack, which shouldn’t happen.

Exception when setting style to JavaScript

Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: org/mozilla/javascript/ast/NodeVisitor
at org.fife.rsta.ac.js.JavaScriptLanguageSupport.install(JavaScriptLanguageSupport.java:287)
at org.fife.rsta.ac.LanguageSupportFactory.installSupport(LanguageSupportFactory.java:171)
at org.fife.rsta.ac.LanguageSupportFactory.propertyChange(LanguageSupportFactory.java:190)
at java.beans.PropertyChangeSupport.fire(Unknown Source)
at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
at java.awt.Component.firePropertyChange(Unknown Source)
at org.fife.ui.rsyntaxtextarea.RSyntaxTextArea.setSyntaxEditingStyle(RSyntaxTextArea.java:2910)
..
Caused by: java.lang.ClassNotFoundException: org.mozilla.javascript.ast.NodeVisitor
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 48 more

Thin only occurs with my project. The DemoApp.java seems to be working fine. Not sure what the demo app is doing different, since every other language seems to work just fine.

Going to text via "Go to member" popup should call selectAndPossiblyCenter()

As it currently is, we may scroll down to the text to select, but the user has no context wrt the lines below it without scrolling down manually. We should mimic the behavior we have for standard find operations and center the matched text vertically in the editor if it is not already in the viewport.

Library vulnerabilities

Hello,
We use languagesupport artifact in our project, and after sources analysis using static veracode analyzer we have found some vulnerabilities.

Please have a look at attached report languagesupport_2.6.pdf to recognize is this real vulnerabilities or an false positive alerts.

System.out.println() should not be called

This issue is being moved from the AutoComplete project, where write to sysout are at least guarded by system properties.

From @ChrisBLN, AutoComplete issue 26:

A lot of printStackTrace and System.out are called by AutoComplete (e. g. in class ASTFactory). This makes my program not very robust.

Could you substitute this two method calls with a java.util.Logger or something like that? Let me know if you need help!

Using Java code completion with Java 8.

I am trying to use Java language support with RSyntaxTextArea in an application compiled using Java 8. Initial attempts resulted in some exceptions being thrown. Specifically there were exceptions being thrown for "Unknown tag for constant pool info" and warnings about parsing signatures (because of double colons :: in some signatures). I made some quick local changes to add support for the missing ConstantPoolInfo tags and changing the parsing in Signature#getClassParamTypes() to skip over double colons and this seems to allow the code completion to work nicely (at least so far!). It seems that it would be relatively easy to improve compatibility with Java 8. However, I'm not an expert in the details of the Java language specification or byte code model (and would prefer not to be!) and I'm sure there are other further implications of these changes that would need to be addressed to make the library stable. I can make my local changes available as a pull request if this is of interest. I am more interested in the code completion aspects than error parsing at this stage.

XML should support very basic element and attribute name completion

Since it's taking me so long to implement DTD and Schema-based code completion, a good compromise is to implement what e.g. Eclipse does by default. On Ctrl+Space (or just typing '<' if auto-completion is enabled), RSTALanguageSupport should scan the document and intelligently offer suggestions.

  • If in a tag name, other tag names in the editor that start with that tag name as a prefix should be suggested.
  • If just after a tag-opening '<' character, tag names in the editor should be suggested.
  • If inside of a tag but not in a tag name, attributes used elsewhere in the document for the current element should be suggested.

JS: Stack trace in source outline tree

java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedMethodAccessor37.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.fife.rtext.plugins.sourcebrowser.SourceBrowserPlugin$1.run(SourceBrowserPlugin.java:237)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$200(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.lang.ClassCastException: org.mozilla.javascript.ast.KeywordLiteral cannot be cast to org.mozilla.javascript.ast.Name
at org.fife.rsta.ac.js.util.RhinoUtil.getPrototypeClazz(RhinoUtil.java:106)
at org.fife.rsta.ac.js.tree.JavaScriptOutlineTreeGenerator.visitExpressionStatement(JavaScriptOutlineTreeGenerator.java:290)
at org.fife.rsta.ac.js.tree.JavaScriptOutlineTreeGenerator.visit(JavaScriptOutlineTreeGenerator.java:183)
at org.mozilla.javascript.ast.ExpressionStatement.visit(ExpressionStatement.java:119)
at org.mozilla.javascript.ast.Scope.visit(Scope.java:251)
at org.mozilla.javascript.ast.ScriptNode.visit(ScriptNode.java:312)
at org.fife.rsta.ac.js.tree.JavaScriptOutlineTreeGenerator.(JavaScriptOutlineTreeGenerator.java:60)
at org.fife.rsta.ac.js.tree.JavaScriptOutlineTree.update(JavaScriptOutlineTree.java:232)
at org.fife.rsta.ac.js.tree.JavaScriptOutlineTree.checkForJavaScriptParsing(JavaScriptOutlineTree.java:115)
at org.fife.rsta.ac.js.tree.JavaScriptOutlineTree.listenTo(JavaScriptOutlineTree.java:199)
at org.fife.rtext.plugins.langsupport.JavaScriptSourceBrowserTreeConstructor.constructSourceBrowserTree(JavaScriptSourceBrowserTreeConstructor.java:45)
at sun.reflect.GeneratedMethodAccessor37.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.fife.rtext.plugins.sourcebrowser.SourceBrowserPlugin$1.run(SourceBrowserPlugin.java:237)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$200(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

auto-completion from xsd

Hi,
I would like to know if it's possible to auto-complete xml nodes from a xsd grammar ?
And is it possible to get the list of first nodes without childnodes (The list of childnodes appears when we are in the node parent like attributes) ? (not all nodes)

Add things to default JavaScriptLanguageSupport

Hello first of all thanks for your effort making this magnificent library.

I'm using the latest version of library (rsyntaxtextarea, autocomplete, languagesupport) and I have been researching all weekend adding stuff to support javascript autocomplete but my snippets not work.

I'm using the autocomplete javascript support language and I want to add code templates and support of autocomplete of my own classes to the default javascript default autocomplete support.

My base code is:

    private RSyntaxTextArea createTextAreaEditor() {
        textAreaEditor = new RSyntaxTextArea();
        textAreaEditor.setCaretPosition(0);
        textAreaEditor.requestFocusInWindow();
        textAreaEditor.setMarkOccurrences(true);
        textAreaEditor.setTabsEmulated(true);
        textAreaEditor.setTabSize(4);
        ToolTipManager.sharedInstance().registerComponent(textAreaEditor);

        textAreaEditor.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVASCRIPT);
        textAreaEditor.setCodeFoldingEnabled(true);
        textAreaEditor.setAntiAliasingEnabled(true);

        return textAreaEditor;
    }

    private void createLanguageSupport() {
        LanguageSupportFactory lsf = LanguageSupportFactory.get();
        lsf.register(textAreaEditor);
        LanguageSupport support = lsf.getSupportFor(SyntaxConstants.SYNTAX_STYLE_JAVASCRIPT);
        JavaScriptLanguageSupport languageSupport = (JavaScriptLanguageSupport) support;
        try {
            languageSupport.getJarManager().addCurrentJreClassFileSource();
        } catch (IOException ex) {
            Logger.getLogger(ScriptEditorJDialog.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

with the the above code the javascript autocomplete default support works fine, when I press "ctrl+." appears a autocomplete with javascript basic functions however I don't know how can add something to autocomplete javascript default support.

My first doubt (add codetemplates to javascript elements):
How can I archive press "Ctrl +.​" and add the new item "log" with the default autocomplete javascript elements?

My second doubt (autocomplete my own classes):
I use in my scripts the java class: "com.example.MyClass" wich is in the "client.jar" file,
My problem is when I define a var of type "MyClass", the autocomplete of membes/methods of var MyClass does not work.
Y define the vars like:

    var n = new Packages.com.example.MyClass();
    n. (autocomplete does not work)
    var r = new MyClass();
    r. (autocomplete does not work)

How can I archive this?
I tried with several examples I've found in the forums but I can not make it work, for example I have tried to add class file source to the jarManager but does not do what I want:

    LanguageSupportFactory lsf = LanguageSupportFactory.get();
    lsf.register(textAreaEditor);
    LanguageSupport support = lsf.getSupportFor(SyntaxConstants.SYNTAX_STYLE_JAVASCRIPT);
    JavaScriptLanguageSupport languageSupport = (JavaScriptLanguageSupport) support;
    JarManager jarManager = languageSupport.getJarManager();
    try {
        jarManager.addClassFileSource(new JarLibraryInfo("d:/projects/client.jar"));
    } catch (IOException ex) {
        Logger.getLogger(ScriptEditorJDialog.class.getName()).log(Level.SEVERE, null, ex);
    }       

I'm using netbeans rcp framework.
Thank you very much for your time and help.

Is there a way to redefine the trigger key?

Hey there,

thank you for the awsome project. Sadly currently i'm facing the problem that the trigger key is already in use and therefore the autocompletion wont come up.

Is there any way to redefine the trigger key?

Thank you in advance!

JavaScript: Support ES6 language features

This library uses an archaic version of Rhino. Newer versions support newer ES6 language features, such as fat arrow, let, etc. We should:

  • Update to the latest version of Rhino
  • Update the library to configure Rhino to use ES6 (its default is ancient, basic JS language features for backward-compatibility reasons, and that's what this library is configured to take by default. It can be changed via JavaScriptLanguageSupport.setLanguageVersion(), but the default should be ES6 to be sensible.

apply my own javascript library to LanguageSupport.

Hi.

I'm trying to make my own html&javascript editor using RSTA&LS&AC.

When I make a new document using above editor, every document will use

my own made js file(kind of common library for me) that contains public or global functions and variables.

so I want to do code-completion about above common library.

after spent whole week, I have no more idea about this.

Does anyone can help about this?

How can I apply my own js library to RSTA and do code-completion successfully?

JavaScript: Support simple angular code completion

Not sure the best set of features for this since I'm still an Angular noob, but it would be nice to support a very small amount of intelligence about Angular, toggle-able with properties on JavaScriptLanguageSupport.

Java code completion

"Calendar.getInstance()." in Java code. In the same case, the code is not complete ?

If you return an Class of a static method, is it not possible to generate the class code complete?

JS code completion should honor variables added to ScriptEngine context

Copied over from SourceForge:

I would like LanguageSupportFactory for JavaScript would work also for classes and variables that are bound using engine put() method when evaluating javascript using java scripting, like:

engine = new ScriptEngineManager().getEngineByName("JavaScript");
engine.put("obj", new MyClass());

So when i type obj. in editor, it would suggest methods of MyClass.

Improve performance of initial completion gathering for Java

There is way too much IO going on for the initial completion discovery for Java, when a JVM is referenced (e.g., we "index" rt.jar). We should open the jar file once and index everything we want, instead of opening and closing it for each class file.

Stack trace in JavaScriptOutlineTree

java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedMethodAccessor16.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.fife.rtext.plugins.sourcebrowser.SourceBrowserPlugin$1.run(SourceBrowserPlugin.java:237)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:715)
at java.awt.EventQueue.access$400(EventQueue.java:82)
at java.awt.EventQueue$2.run(EventQueue.java:676)
at java.awt.EventQueue$2.run(EventQueue.java:674)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:86)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:685)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Caused by: java.lang.ClassCastException: org.mozilla.javascript.ast.KeywordLiteral cannot be cast to org.mozilla.javascript.ast.Name
at org.fife.rsta.ac.js.util.RhinoUtil.getPrototypeClazz(RhinoUtil.java:106)
at org.fife.rsta.ac.js.tree.JavaScriptOutlineTreeGenerator.visitExpressionStatement(JavaScriptOutlineTreeGenerator.java:290)
at org.fife.rsta.ac.js.tree.JavaScriptOutlineTreeGenerator.visit(JavaScriptOutlineTreeGenerator.java:183)
at org.mozilla.javascript.ast.ExpressionStatement.visit(ExpressionStatement.java:119)
at org.mozilla.javascript.ast.Scope.visit(Scope.java:251)
at org.mozilla.javascript.ast.ScriptNode.visit(ScriptNode.java:312)
at org.fife.rsta.ac.js.tree.JavaScriptOutlineTreeGenerator.(JavaScriptOutlineTreeGenerator.java:60)
at org.fife.rsta.ac.js.tree.JavaScriptOutlineTree.update(JavaScriptOutlineTree.java:232)
at org.fife.rsta.ac.js.tree.JavaScriptOutlineTree.checkForJavaScriptParsing(JavaScriptOutlineTree.java:115)
at org.fife.rsta.ac.js.tree.JavaScriptOutlineTree.listenTo(JavaScriptOutlineTree.java:199)
at org.fife.rtext.plugins.langsupport.JavaScriptSourceBrowserTreeConstructor.constructSourceBrowserTree(JavaScriptSourceBrowserTreeConstructor.java:45)
at sun.reflect.GeneratedMethodAccessor16.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.fife.rtext.plugins.sourcebrowser.SourceBrowserPlugin$1.run(SourceBrowserPlugin.java:237)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:715)
at java.awt.EventQueue.access$400(EventQueue.java:82)
at java.awt.EventQueue$2.run(EventQueue.java:676)
at java.awt.EventQueue$2.run(EventQueue.java:674)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:86)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:685)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

JavaScript: Global types such as "Math" not recognized

Create an empty RSTA instance, set syntax highlighting to JavaScript and install the JS language support. Type "Math." Completions for the Math global object are not suggested, even though (I believe) the default is being set to ECMAScript v3.

Code completion for Less

Code completion for Less should be a superset of what we have for CSS, but also include completion of variable names.

XML: Source tree is very slow to render with large XML files

For very large XML files (> 5MB, thousands of nested elements), XmlOutlineTree takes a very long time to render. It seems 99% of the time is spent in "expand all nodes" code. While there might be further improvements we can make, simply removing all TreeExpansionListeners before starting the expand-all operation, and adding them back afterwards, removes almost all of the lag.

For comparison - for a 5 MB file, we're going from an ~ 30 second render time to a < 2 second render time. Delays grow linearly, or worse, as files get larger.

Improve code completion for Java

Eclipse wrote an compiler called ECJ, it include an complete AST parser which support Java1.5 - Java 1.8, you can use it to support better code hinting and error warning :)

Error at building RSTALanguageSupport

Hello!

I've downloaded the project and compiled all the others projects and placed in the correct folders (as configured in build.xml), but..for some reason, these errors occurs when i run antin the RSTALanguageSupport directory.

Buildfile: /home/fernando/RSTALanguageSupport-0.9.3/build.xml

compile:
   [delete] Deleting directory /home/fernando/RSTALanguageSupport-0.9.3/ant-classes
    [mkdir] Created dir: /home/fernando/RSTALanguageSupport-0.9.3/ant-classes
    [javac] Compiling 259 source files to /home/fernando/RSTALanguageSupport-0.9.3/ant-classes
    [javac] warning: [options] bootstrap class path not set in conjunction with -source 1.4
    [javac] /home/fernando/RSTALanguageSupport-0.9.3/src/org/fife/rsta/ac/js/ecma/api/e4x/functions/E4XXMLFunctions.java:27: warning: unmappable character for encoding UTF8
    [javac]      * <b>function appendChild(xml)</b> appends the given child to the end of this XML object�s properties and returns this XML object.
    [javac]                                                                                              ^
    [javac] /home/fernando/RSTALanguageSupport-0.9.3/src/org/fife/rsta/ac/js/ecma/api/e4x/functions/E4XXMLFunctions.java:317: warning: unmappable character for encoding UTF8
    [javac]      * // Get the parent element of the second name in "e". Returns {@code <employee id="1" �}
    [javac]                                                                                             ^
    [javac] /home/fernando/RSTALanguageSupport-0.9.3/src/org/fife/rsta/ac/js/ecma/api/e4x/functions/E4XXMLFunctions.java:363: warning: unmappable character for encoding UTF8
    [javac]      * <b>function replace(propertyName, value)</b> replaces the XML properties of this XML object specified by propertyName with value and returns this XML object. If this XML object contains no properties that match propertyName, the replace method returns without modifying this XML object. The propertyName parameter may be a numeric property name, an unqualified name for a set of XML elements, a qualified name for a set of XML elements or the properties wildcard �*�. When the propertyName parameter is an unqualified name, it identifies XML elements in the default namespace. The value parameter may be an XML object, XMLList object or any value that may be converted to a String with ToString().
    [javac]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       ^
    [javac] /home/fernando/RSTALanguageSupport-0.9.3/src/org/fife/rsta/ac/js/ecma/api/e4x/functions/E4XXMLFunctions.java:363: warning: unmappable character for encoding UTF8
    [javac]      * <b>function replace(propertyName, value)</b> replaces the XML properties of this XML object specified by propertyName with value and returns this XML object. If this XML object contains no properties that match propertyName, the replace method returns without modifying this XML object. The propertyName parameter may be a numeric property name, an unqualified name for a set of XML elements, a qualified name for a set of XML elements or the properties wildcard �*�. When the propertyName parameter is an unqualified name, it identifies XML elements in the default namespace. The value parameter may be an XML object, XMLList object or any value that may be converted to a String with ToString().
    [javac]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         ^
    [javac] /home/fernando/RSTALanguageSupport-0.9.3/src/org/fife/rsta/ac/js/ecma/api/e4x/functions/E4XXMLFunctions.java:382: warning: unmappable character for encoding UTF8
    [javac]      * <b>function replace(propertyName, value)</b> replaces the XML properties of this XML object specified by propertyName with value and returns this XML object. If this XML object contains no properties that match propertyName, the replace method returns without modifying this XML object. The propertyName parameter may be a numeric property name, an unqualified name for a set of XML elements, a qualified name for a set of XML elements or the properties wildcard �*�. When the propertyName parameter is an unqualified name, it identifies XML elements in the default namespace. The value parameter may be an XML object, XMLList object or any value that may be converted to a String with ToString().
    [javac]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       ^
    [javac] /home/fernando/RSTALanguageSupport-0.9.3/src/org/fife/rsta/ac/js/ecma/api/e4x/functions/E4XXMLFunctions.java:382: warning: unmappable character for encoding UTF8
    [javac]      * <b>function replace(propertyName, value)</b> replaces the XML properties of this XML object specified by propertyName with value and returns this XML object. If this XML object contains no properties that match propertyName, the replace method returns without modifying this XML object. The propertyName parameter may be a numeric property name, an unqualified name for a set of XML elements, a qualified name for a set of XML elements or the properties wildcard �*�. When the propertyName parameter is an unqualified name, it identifies XML elements in the default namespace. The value parameter may be an XML object, XMLList object or any value that may be converted to a String with ToString().
    [javac]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         ^
    [javac] /home/fernando/RSTALanguageSupport-0.9.3/src/org/fife/rsta/ac/AbstractMarkupLanguageSupport.java:194: error: cannot find symbol
    [javac]                 if (t.type==Token.MARKUP_TAG_DELIMITER) {
    [javac]                      ^
    [javac]   symbol:   variable type
    [javac]   location: variable t of type Token
    [javac] /home/fernando/RSTALanguageSupport-0.9.3/src/org/fife/rsta/ac/AbstractMarkupLanguageSupport.java:202: error: cannot find symbol
    [javac]                         if (t.offset==dot) {
    [javac]                              ^
    [javac]   symbol:   variable offset
    [javac]   location: variable t of type Token
    [javac] /home/fernando/RSTALanguageSupport-0.9.3/src/org/fife/rsta/ac/groovy/GroovySourceCompletionProvider.java:127: error: cannot find symbol
    [javac]                 block.setEndOffset(t.textOffset);
    [javac]                                     ^
    [javac]   symbol:   variable textOffset
    [javac]   location: variable t of type Token
    [javac] /home/fernando/RSTALanguageSupport-0.9.3/src/org/fife/rsta/ac/groovy/GroovySourceCompletionProvider.java:130: error: cannot find symbol
    [javac]                 CodeBlock child = block.addChildCodeBlock(t.textOffset);
    [javac]                                                            ^
    [javac]   symbol:   variable textOffset
    [javac]   location: variable t of type Token
    [javac] /home/fernando/RSTALanguageSupport-0.9.3/src/org/fife/rsta/ac/groovy/GroovySourceCompletionProvider.java:136: error: cannot find symbol
    [javac]                             .getLexeme(), t.textOffset);
    [javac]                                            ^
    [javac]   symbol:   variable textOffset
    [javac]   location: variable t of type Token
    [javac] /home/fernando/RSTALanguageSupport-0.9.3/src/org/fife/rsta/ac/html/HtmlCompletionProvider.java:121: error: cannot find symbol
    [javac]             else if (t.type==Token.MARKUP_TAG_NAME) {
    [javac]                       ^
    [javac]   symbol:   variable type
    [javac]   location: variable t of type Token
    [javac] /home/fernando/RSTALanguageSupport-0.9.3/src/org/fife/rsta/ac/html/HtmlCompletionProvider.java:124: error: cannot find symbol
    [javac]             else if (t.type==Token.MARKUP_TAG_DELIMITER) {
    [javac]                       ^
    [javac]   symbol:   variable type
    [javac]   location: variable t of type Token
    [javac] /home/fernando/RSTALanguageSupport-0.9.3/src/org/fife/rsta/ac/html/HtmlCompletionProvider.java:143: error: cannot find symbol
    [javac]                     if (t.type==Token.MARKUP_TAG_NAME) {
    [javac]                          ^
    [javac]   symbol:   variable type
    [javac]   location: variable t of type Token
    [javac] /home/fernando/RSTALanguageSupport-0.9.3/src/org/fife/rsta/ac/html/HtmlCompletionProvider.java:146: error: cannot find symbol
    [javac]                     else if (t.type==Token.MARKUP_TAG_DELIMITER) {
    [javac]                               ^
    [javac]   symbol:   variable type
    [javac]   location: variable t of type Token
    [javac] /home/fernando/RSTALanguageSupport-0.9.3/src/org/fife/rsta/ac/html/HtmlCompletionProvider.java:203: error: cannot find symbol
    [javac]                         else if (t.type==Token.MARKUP_TAG_DELIMITER) {
    [javac]                                   ^
    [javac]   symbol:   variable type
    [javac]   location: variable t of type Token
    [javac] /home/fernando/RSTALanguageSupport-0.9.3/src/org/fife/rsta/ac/html/HtmlCompletionProvider.java:211: error: cannot find symbol
    [javac]                         else if (t.type==Token.WHITESPACE) {
    [javac]                                   ^
    [javac]   symbol:   variable type
    [javac]   location: variable t of type Token
    [javac] /home/fernando/RSTALanguageSupport-0.9.3/src/org/fife/rsta/ac/html/HtmlCompletionProvider.java:220: error: cannot find symbol
    [javac]                         else if (t.type!=Token.MARKUP_TAG_ATTRIBUTE &&
    [javac]                                   ^
    [javac]   symbol:   variable type
    [javac]   location: variable t of type Token
    [javac] /home/fernando/RSTALanguageSupport-0.9.3/src/org/fife/rsta/ac/html/HtmlCompletionProvider.java:221: error: cannot find symbol
    [javac]                                 t.type!=Token.MARKUP_TAG_NAME) {
    [javac]                                  ^
    [javac]   symbol:   variable type
    [javac]   location: variable t of type Token
    [javac] /home/fernando/RSTALanguageSupport-0.9.3/src/org/fife/rsta/ac/html/HtmlCompletionProvider.java:229: error: cannot find symbol
    [javac]                             if (t.type>-1 || t.type<-9) {
    [javac]                                  ^
    [javac]   symbol:   variable type
    [javac]   location: variable t of type Token
    [javac] /home/fernando/RSTALanguageSupport-0.9.3/src/org/fife/rsta/ac/html/HtmlCompletionProvider.java:229: error: cannot find symbol
    [javac]                             if (t.type>-1 || t.type<-9) {
    [javac]                                               ^
    [javac]   symbol:   variable type
    [javac]   location: variable t of type Token
    [javac] /home/fernando/RSTALanguageSupport-0.9.3/src/org/fife/rsta/ac/html/HtmlCompletionProvider.java:384: error: cannot find symbol
    [javac]             switch (t.type) {
    [javac]                      ^
    [javac]   symbol:   variable type
    [javac]   location: variable t of type Token
    [javac] /home/fernando/RSTALanguageSupport-0.9.3/src/org/fife/rsta/ac/html/HtmlCompletionProvider.java:461: error: cannot find symbol
    [javac]             (t.textCount==2 && t.text[t.textOffset]=='<' &&
    [javac]               ^
    [javac]   symbol:   variable textCount
    [javac]   location: variable t of type Token
    [javac] /home/fernando/RSTALanguageSupport-0.9.3/src/org/fife/rsta/ac/html/HtmlCompletionProvider.java:461: error: cannot find symbol
    [javac]             (t.textCount==2 && t.text[t.textOffset]=='<' &&
    [javac]                                 ^
    [javac]   symbol:   variable text
    [javac]   location: variable t of type Token
    [javac] /home/fernando/RSTALanguageSupport-0.9.3/src/org/fife/rsta/ac/html/HtmlCompletionProvider.java:461: error: cannot find symbol
    [javac]             (t.textCount==2 && t.text[t.textOffset]=='<' &&
    [javac]                                        ^
    [javac]   symbol:   variable textOffset
    [javac]   location: variable t of type Token
    [javac] /home/fernando/RSTALanguageSupport-0.9.3/src/org/fife/rsta/ac/html/HtmlCompletionProvider.java:462: error: cannot find symbol
    [javac]                     t.text[t.textOffset+1]=='/');
    [javac]                      ^
    [javac]   symbol:   variable text
    [javac]   location: variable t of type Token
    [javac] /home/fernando/RSTALanguageSupport-0.9.3/src/org/fife/rsta/ac/html/HtmlCompletionProvider.java:462: error: cannot find symbol
    [javac]                     t.text[t.textOffset+1]=='/');
    [javac]                             ^
    [javac]   symbol:   variable textOffset
    [javac]   location: variable t of type Token
    [javac] /home/fernando/RSTALanguageSupport-0.9.3/src/org/fife/rsta/ac/java/AbstractJavaSourceCompletion.java:45: warning: compareTo(Object) in AbstractJavaSourceCompletion overrides compareTo(Object) in AbstractCompletion; overridden method is a bridge method
    [javac]     public int compareTo(Object o) {
    [javac]                ^
    [javac] /home/fernando/RSTALanguageSupport-0.9.3/src/org/fife/rsta/ac/java/ClassCompletion.java:49: warning: compareTo(Object) in ClassCompletion overrides compareTo(Object) in AbstractCompletion; overridden method is a bridge method
    [javac]     public int compareTo(Object o) {
    [javac]                ^
    [javac] /home/fernando/RSTALanguageSupport-0.9.3/src/org/fife/rsta/ac/java/SourceCompletionProvider.java:427: error: cannot find symbol
    [javac]                             prevToken.type==Token.LITERAL_STRING_DOUBLE_QUOTE) {
    [javac]                                      ^
    [javac]   symbol:   variable type
    [javac]   location: variable prevToken of type Token
    [javac] /home/fernando/RSTALanguageSupport-0.9.3/src/org/fife/rsta/ac/java/JavaLinkGenerator.java:82: error: Token is abstract; cannot be instantiated
    [javac]                         Token token = new Token(t);
    [javac]                                       ^
    [javac] /home/fernando/RSTALanguageSupport-0.9.3/src/org/fife/rsta/ac/java/JavaLinkGenerator.java:229: error: cannot find symbol
    [javac]                 return new SelectRegionLinkGeneratorResult(textArea, t.offset,
    [javac]                                                                       ^
    [javac]   symbol:   variable offset
    [javac]   location: variable t of type Token
    [javac] /home/fernando/RSTALanguageSupport-0.9.3/src/org/fife/rsta/ac/java/MethodCompletion.java:126: warning: compareTo(Object) in MethodCompletion overrides compareTo(Object) in AbstractCompletion; overridden method is a bridge method
    [javac]     public int compareTo(Object o) {
    [javac]                ^
    [javac] /home/fernando/RSTALanguageSupport-0.9.3/src/org/fife/rsta/ac/js/completion/JSBeanCompletion.java:144: warning: compareTo(Object) in JSBeanCompletion overrides compareTo(Object) in AbstractCompletion; overridden method is a bridge method
    [javac]     public int compareTo(Object o) {
    [javac]                ^
    [javac] /home/fernando/RSTALanguageSupport-0.9.3/src/org/fife/rsta/ac/js/completion/JSClassCompletion.java:42: warning: compareTo(Object) in JSClassCompletion overrides compareTo(Object) in AbstractCompletion; overridden method is a bridge method
    [javac]     public int compareTo(Object o) {
    [javac]                ^
    [javac] /home/fernando/RSTALanguageSupport-0.9.3/src/org/fife/rsta/ac/js/completion/JSFunctionCompletion.java:80: warning: compareTo(Object) in JSFunctionCompletion overrides compareTo(Object) in AbstractCompletion; overridden method is a bridge method
    [javac]     public int compareTo(Object o) {
    [javac]                ^
    [javac] /home/fernando/RSTALanguageSupport-0.9.3/src/org/fife/rsta/ac/js/completion/JSFieldCompletion.java:107: warning: compareTo(Object) in JSFieldCompletion overrides compareTo(Object) in AbstractCompletion; overridden method is a bridge method
    [javac]     public int compareTo(Object o) {
    [javac]                ^
    [javac] /home/fernando/RSTALanguageSupport-0.9.3/src/org/fife/rsta/ac/js/completion/JSVariableCompletion.java:105: warning: compareTo(Object) in JSVariableCompletion overrides compareTo(Object) in AbstractCompletion; overridden method is a bridge method
    [javac]     public int compareTo(Object o) {
    [javac]                ^
    [javac] /home/fernando/RSTALanguageSupport-0.9.3/src/org/fife/rsta/ac/js/completion/JavaScriptInScriptFunctionCompletion.java:102: warning: compareTo(Object) in JavaScriptInScriptFunctionCompletion overrides compareTo(Object) in AbstractCompletion; overridden method is a bridge method
    [javac]     public int compareTo(Object o) {
    [javac]                ^
    [javac] /home/fernando/RSTALanguageSupport-0.9.3/src/org/fife/rsta/ac/js/completion/JavaScriptMethodCompletion.java:119: warning: compareTo(Object) in JavaScriptMethodCompletion overrides compareTo(Object) in AbstractCompletion; overridden method is a bridge method
    [javac]     public int compareTo(Object o) {
    [javac]                ^
    [javac] /home/fernando/RSTALanguageSupport-0.9.3/src/org/fife/rsta/ac/perl/PerlCompletionProvider.java:229: error: cannot find symbol
    [javac]                 block.setEndOffset(t.textOffset);
    [javac]                                     ^
    [javac]   symbol:   variable textOffset
    [javac]   location: variable t of type Token
    [javac] /home/fernando/RSTALanguageSupport-0.9.3/src/org/fife/rsta/ac/perl/PerlCompletionProvider.java:233: error: cannot find symbol
    [javac]                 CodeBlock child = block.addChildCodeBlock(t.textOffset);
    [javac]                                                            ^
    [javac]   symbol:   variable textOffset
    [javac]   location: variable t of type Token
    [javac] /home/fernando/RSTALanguageSupport-0.9.3/src/org/fife/rsta/ac/perl/PerlCompletionProvider.java:236: error: cannot find symbol
    [javac]             else if (t.type==Token.VARIABLE) {
    [javac]                       ^
    [javac]   symbol:   variable type
    [javac]   location: variable t of type Token
    [javac] /home/fernando/RSTALanguageSupport-0.9.3/src/org/fife/rsta/ac/perl/PerlCompletionProvider.java:238: error: cannot find symbol
    [javac]                         t.getLexeme(), t.textOffset);
    [javac]                                         ^
    [javac]   symbol:   variable textOffset
    [javac]   location: variable t of type Token
    [javac] /home/fernando/RSTALanguageSupport-0.9.3/src/org/fife/rsta/ac/php/PhpCompletionProvider.java:214: error: cannot find symbol
    [javac]         while (token!=null && token.isPaintable() && token.offset<=dot) {
    [javac]                                                           ^
    [javac]   symbol:   variable offset
    [javac]   location: variable token of type Token
    [javac] /home/fernando/RSTALanguageSupport-0.9.3/src/org/fife/rsta/ac/php/PhpCompletionProvider.java:215: error: cannot find symbol
    [javac]             if (token.type==Token.SEPARATOR && token.textCount>=2) {
    [javac]                      ^
    [javac]   symbol:   variable type
    [javac]   location: variable token of type Token
    [javac] /home/fernando/RSTALanguageSupport-0.9.3/src/org/fife/rsta/ac/php/PhpCompletionProvider.java:215: error: cannot find symbol
    [javac]             if (token.type==Token.SEPARATOR && token.textCount>=2) {
    [javac]                                                     ^
    [javac]   symbol:   variable textCount
    [javac]   location: variable token of type Token
    [javac] /home/fernando/RSTALanguageSupport-0.9.3/src/org/fife/rsta/ac/php/PhpCompletionProvider.java:216: error: cannot find symbol
    [javac]                 char ch1 = token.text[token.textOffset];
    [javac]                                 ^
    [javac]   symbol:   variable text
    [javac]   location: variable token of type Token
    [javac] /home/fernando/RSTALanguageSupport-0.9.3/src/org/fife/rsta/ac/php/PhpCompletionProvider.java:216: error: cannot find symbol
    [javac]                 char ch1 = token.text[token.textOffset];
    [javac]                                            ^
    [javac]   symbol:   variable textOffset
    [javac]   location: variable token of type Token
    [javac] /home/fernando/RSTALanguageSupport-0.9.3/src/org/fife/rsta/ac/php/PhpCompletionProvider.java:217: error: cannot find symbol
    [javac]                 char ch2 = token.text[token.textOffset+1];
    [javac]                                 ^
    [javac]   symbol:   variable text
    [javac]   location: variable token of type Token
    [javac] /home/fernando/RSTALanguageSupport-0.9.3/src/org/fife/rsta/ac/php/PhpCompletionProvider.java:217: error: cannot find symbol
    [javac]                 char ch2 = token.text[token.textOffset+1];
    [javac]                                            ^
    [javac]   symbol:   variable textOffset
    [javac]   location: variable token of type Token
    [javac] 35 errors
    [javac] 17 warnings

I'm using the following version of Java:

java version "1.7.0_21"
Java(TM) SE Runtime Environment (build 1.7.0_21-b11)
Java HotSpot(TM) 64-Bit Server VM (build 23.21-b01, mixed mode)

In Ubuntu 12.04.3 LTS.

How to fix it? (it's really a bug or i'm building the project wrong?)

Issues with ./gradlew install

Two issues prevent ./gradlew install from working:

  1. No group specified
  2. Signing should not be required (for folks not allowed to upload to Sonatype).

Signing should still be required when publishing artifacts to Sonatype/Maven Central.

JavaScript: Understand prototypes that are function expressions

The JavaScriptOutlineTree and code completion currently do not understand JS objects whose prototypes are defined as function expressions, e.g.

function Conversation() {
  ...
}
Conversation.prototype = (function() {
   return {
      foo: function() {
         return true;
      }
   };
})();

LibraryInfo fail for Java >= 11

I tried to run the org.fife.rsta.ac.demo.DemoApp class in AdoptOpenJDK 11.0.9.101, but a null pointer exception is thrown. I debugged the code and found the problem.

In the org.fife.rsta.ac.java.buildpath.LibraryInfo class, the getJreJarInfo() method looks for the rt.jar file, but in Java 11 and later this file has been changed to jrt-fs.jar.

I fixed this problem locally for Windows 10, but I don't know the behavior of this change on other OS:

public static LibraryInfo getJreJarInfo(File jreHome) {

    LibraryInfo info = null;

    File mainJar = new File(jreHome, "lib/rt.jar"); // Sun JRE's
    File sourceZip;

    if (mainJar.isFile()) { // Sun JRE's
        sourceZip = new File(jreHome, "src.zip");
        if (!sourceZip.isFile()) {
            // Might be a JRE inside a JDK
            sourceZip = new File(jreHome, "../src.zip");
        }
    } else { // Might be OS X
        mainJar = new File(jreHome, "../Classes/classes.jar");
        // ${java.home}/src.jar is the common location on OS X.
        sourceZip = new File(jreHome, "src.jar");
    }

    //////////////////////////////////////////////////
    if (!mainJar.isFile()) { // Java 11 and later
        mainJar = new File(jreHome, "lib/jrt-fs.jar");
        sourceZip = new File(jreHome, "src.zip");
    }
    //////////////////////////////////////////////////

    if (mainJar.isFile()) {
        info = new JarLibraryInfo(mainJar);
        if (sourceZip.isFile()) { // Make sure our last guess actually exists
            info.setSourceLocation(new ZipSourceLocation(sourceZip));
        }
    } else {
        System.err.println("[ERROR]: Cannot locate JRE jar in " + jreHome.getAbsolutePath());
        mainJar = null;
    }

    return info;

}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.