Problematically importing TextMate packages

Answered

I'm developing a new language for Intellij CE. I would like to bundle the TextMange bundle json for that language and import it problematically from my plugin into IntelliJ. Is it possible to do this without asking the user to import the bundle through the settings UI ?

0
7 comments

Hi, 

You can import it programmatically:

TextMateSettings.getInstance().getState().setBundles()

the reload bundles:

textMateService = TextMateService.getInstance();
textMateService.unregisterAllBundles(false);
textMateService.reloadThemesFromDisk();
textMateService.registerEnabledBundles(true);
1

zolotov Is this still possible? What package would these classes be found in? Otherwise, how would I programmatically import a TextMate bundle shipped with my IJ IDEA Ultimate plugin?

0

yes, there is still a way

```

org.jetbrains.plugins.textmate.configuration.TextMateUserBundlesSettings#addBundle

```

0

zolotov Thank you. How do I get this into the classpath though? The plugin is now bundled, and if I include it in `intellij.plugins` and build the project, I still cannot import the class (`org.jetbrains.plugins.textmate` is not known in my Java code).

0

Tim Schulze-Hartung As I see, this class is present since 232. Which IntelliJ Platform version do you target?

0

Jakub Chrzanowski I'm targeting IU 2023.2.4 (since=232, until=232.*), so I think this should be fine, right?

Should it suffice to add this to the Gradle build script to access the package?
```
intellij {
   plugins = ['org.jetbrains.plugins.textmate']
}
```

0

I just checked it with the configuration you provided, and the mentioned class is available:

intellij {
  type = “IU”
  version = “2023.2.4”
  plugins = listOf("org.jetbrains.plugins.textmate")
}

0

Please sign in to leave a comment.