Using "any" language with LanguageExtensionPoint

Answered

There exists a Language.ANY, which I take to be a wildcard language, but it does not appear any of the extensions using LanguageExtensionPoint treat it as a wildcard. Is there a way to make those extensions treat it as a wildcard?

For example, I use the codeInsight.lineMarkerProvider extension in a language-agnostic way, but to enable this extension I have to add XML explicitly listing all the languages I want it to work on.

0
3 comments

Did you try registering it with language="" (empty)? AFAIU it should work for LineMarkerProvider - for some extensions indeed specifying explicit language is required.

0

Yeah, you're right. language="" works with LineMarkerProvider. I was unsuccessful in getting it to work with InlayProvider, noticed it extended LanguageExtensionPoint, and erroneously assumed LineMarkerProvider would work the same.

Is there any reason InlayProvider can't work with "any" language or is that just how it has always worked?

0

I'd guess it's by design, the assumption might be there's no inlays that would work across a set of multiple languages in the same way.

0

Please sign in to leave a comment.