Plugins for pre-existing languages

Answered

I'd like to create a plugin for YAML files to resolve references to Java classes in YAML code and to be able to click on Java classes and constructors and find usages in YAML files. How do I do that without overriding the pre-existing YAML and Java plugins?

This is an example of some yaml code I'd be using

com.foo.FooBar:

    someParam: null

Which would call new FooBar(null)

0
4 comments
Avatar
Permanently deleted user

So I won’t have to write my own implementation of Java for this?
Also, how do I add the ability to include YAML references when I say find usages for a certain Java class?

0

No, you do not need to reinvent YAML/Java support. You can extend IDE with a custom Reference Contributor Extensions Point and handle already defined Psi elements in a way that you want.

Regarding the second question - I'd start with finding the proper PsiElements in the YAML file, then using `com.foo.FooBar` fully-qualified name, resolving proper PsiFile.

0
Avatar
Permanently deleted user

Thanks, I'll do that.

0

Please sign in to leave a comment.