jenkinsci / idea-stapler-plugin

Jenkins Development Support for IntelliJ IDEA
https://plugins.jetbrains.com/plugin/1885-jenkins-development-support/
BSD 2-Clause "Simplified" License
9 stars 19 forks source link

Add support for groovy views as well as help files in the structure view #150

Closed Vlatombe closed 1 year ago

Vlatombe commented 1 year ago
duemir commented 1 year ago

I think it is a good idea to compare the File Type, but I think it'll be better to keep it typesafe and compare it with FileType instances. I'll doodle a bit to figure out the approach. Maybe I am overthinking it, but I want to add a Groovy plugin as an optional dependency.

duemir commented 1 year ago

I made it work which made me realise that it'll lead to groovy views showing up only when Groovy plugin is installed. So this should probably be just right. Maybe using file extensions will make it closer to stapler itself 🤔

duemir commented 1 year ago

Well, this implementation doesn't work if the Groovy plugin is not installed. Without the plugin, there is no "Groovy" file type.

duemir commented 1 year ago

153 is my rough idea of how to do it via the Extension Point.

duemir commented 1 year ago

@timja can you give your two cents?

timja commented 1 year ago

Does this assume all groovy files could be views?


No strong opinions on this, generally I convert groovy views to jelly if I have to do anything nontrivial on them. We don't really recommend groovy views for new code.

duemir commented 1 year ago

Does this assume all groovy files could be views?

All groovy files in a package that has the same name as fully qualified name of a class for which structure view is constructed

timja commented 1 year ago

Does this assume all groovy files could be views?

All groovy files in a package that has the same name as fully qualified name of a class for which structure view is constructed

ok so sounds safe enough