Plugin development: How to get extension names of all supported file types?

Answered

I am developing a language plugin, and specified supported file types in plugin.xml, for example which are `ss` and `scm`.

When this plugin is be using, user can add another file type to this plugin, via `Setting` -> `Editor` -> `File Types`, for example the user added the `*.rkt`.

Now I want my plugin to search file by file name (without extension), called `xxx`. Since the plugin support `*.ss`, `*.scm`, and `*.rkt`, so I need to search `xxx.ss`, `xxx.scm`, and `xxx.rkt`.

But I don't know how to get the complete list of extension names of those three file types, especially the user added `*.rkt`.

Is there a way to get the list of extension names of all supported file types?

0
2 comments

Hi,

Please try to use com.intellij.openapi.fileTypes.FileTypeManager.

1

It's useful, thank you!

0

Please sign in to leave a comment.