Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Compatibility with Maven projects (ceylon-maven-plugin)? #10

Open
negora opened this issue Sep 26, 2017 · 4 comments
Open

Compatibility with Maven projects (ceylon-maven-plugin)? #10

negora opened this issue Sep 26, 2017 · 4 comments

Comments

@negora
Copy link

negora commented Sep 26, 2017

exception.log
Hello:

When I open a Maven project that uses the ceylon-maven-plugin, NetBeans throws the following exception (I've attached the full stack trace at the top of this report):

ceylon.language.AssertionError "Assertion failed
	violated is NbCeylonProject _p = projects.getProject(project)
		expression has type ceylon.language::null which is not a subtype of com.redhat.ceylon.ide.netbeans.model::NbCeylonProject"

I guess that it's because the ceylon-ide-netbeans plug-in doesn't recognize this project as an authentic Ceylon project.

Would it be complicated/risky to enable the features of your plug-in with Maven projects, provided that they also contain a .ceylon directory? Would this feature qualify them as true Ceylon projects? I've tried to add a .ceylon/config file, but the plug-in still throws the error. What does the plug-in use for the detection?

There's a TypeScript plug-in for NetBeans, called nbts, that uses the existence of a tsconfig.json file as a sign that the project contains TypeScript files, and that it must analyse them. This allows the usage of TypeScript code in other type of projects, such as ones of Java/Maven or HTML5. Maybe the Ceylon plug-in could do something similar? Taking into account that ceylon-maven-plugin is able to keep the Maven and Ceylon descriptors in synchronization, Would it be a plausible idea?

Thank you!

@bjansen
Copy link
Member

bjansen commented Sep 26, 2017

The plugin checks for the presence of a .ceylon directory to detect if it's a Ceylon project. What might be happening is that the Maven project factory sees the pom.xml, and because it has a higher priority than our project factory NetBeans will thus the project as a Maven project.

The Ceylon plugin is able to add Ceylon features to J2SE and Module projects, I suppose it would be feasible to add Ceylon features to Maven projects as well.

BTW could you please paste the whole stack trace associated to the error above?

@negora
Copy link
Author

negora commented Sep 26, 2017

The plugin checks for the presence of a .ceylon directory to detect if it's a Ceylon project. What might be happening is that the Maven project factory sees the pom.xml, and because it has a higher priority than our project factory NetBeans will thus the project as a Maven project.

Interesting. I had no idea how these things worked.

This the exception's stack trace:

ceylon.language.AssertionError "Assertion failed
	violated is NbCeylonProject _p = projects.getProject(project)
		expression has type ceylon.language::null which is not a subtype of com.redhat.ceylon.ide.netbeans.model::NbCeylonProject"
	at com.redhat.ceylon.ide.netbeans.model.CeylonParseController.<init>(CeylonParseController.ceylon:104)
	at com.redhat.ceylon.ide.netbeans.model.findParseController_.findParseController(CeylonParseController.ceylon:74)
	at com.redhat.ceylon.ide.netbeans.editor.CeylonSyntaxErrorHighlightingTask.run(CeylonSyntaxErrorHighlightingTask.ceylon:98)
	at org.netbeans.modules.parsing.impl.TaskProcessor.callParserResultTask(TaskProcessor.java:584)
	at org.netbeans.modules.parsing.impl.TaskProcessor$RequestPerformer.run(TaskProcessor.java:809)
	at org.openide.util.lookup.Lookups.executeWith(Lookups.java:304)
	at org.netbeans.modules.parsing.impl.TaskProcessor$RequestPerformer.execute(TaskProcessor.java:725)
[catch] at org.netbeans.modules.parsing.impl.TaskProcessor$CompilationJob.run(TaskProcessor.java:686)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1443)
	at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:68)
	at org.openide.util.lookup.Lookups.executeWith(Lookups.java:303)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2058)

@bjansen
Copy link
Member

bjansen commented Sep 26, 2017

Under the hood, plugins can register a ProjectFactory to help NetBeans decide what kind of in-memory representation should be created when it loads a project from disk. If multiple project factories return true in isProject(), then a priority defined during registration will determine which one wins.

Regarding the stack trace, I'm tempted to consider this as a bug, because the plugin should simply skip the error highlighting part on non-Ceylon projects that contain Ceylon files.

This issue is both a bug and a feature request :)

@negora
Copy link
Author

negora commented Sep 26, 2017

Under the hood, plugins can register a ProjectFactory to help NetBeans decide what kind of in-memory representation should be created when it loads a project from disk. If multiple project factories return true in isProject(), then a priority defined during registration will determine which one wins.

Time ago, I don't remember where, I read that NetBeans was better designed internally than Eclipse, with regard to plug-ins. I guess that what you comment is one of the reasons for that. Because when I mix plug-ins for several languages in Eclipse, usually they end "exploding" on my face :P . Indeed, I'm trying to mix ceylon-maven-plugin and ceylon-ide-eclipse, and I'm having some serious problems. I've to open a bug report for that project, by the way.

Regarding the stack trace, I'm tempted to consider this as a bug, because the plugin should simply skip the error highlighting part on non-Ceylon projects that contain Ceylon files.

This issue is both a bug and a feature request :)

Agreed. Thank you for your detailed explanations ;) .

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants