language-mcfunction icon indicating copy to clipboard operation
language-mcfunction copied to clipboard

Add support for Jetbrains products

Open Martmists-GH opened this issue 4 years ago • 8 comments

Martmists-GH avatar Jan 01 '20 16:01 Martmists-GH

I've never developed plugins for JetBrains products. Do you know if we can simply plug-in an existing TextMate language definition (tmLanguage)? This is how SublimeText was supported so easily - barring that I still need to submit it to Package Control (#21).

If it's on the same level as SublimeText support, I'd be willing to do it. Otherwise, if it requires a completely new language definition (such as people have requested for Notepad++ and HighlightJS), it's definitely out-of-scope.

Arcensoth avatar Jan 08 '20 16:01 Arcensoth

Jetbrains products should support TextMate through this plugin

Martmists-GH avatar Jan 08 '20 17:01 Martmists-GH

This would be really really nice

emielderckx avatar Jan 09 '21 17:01 emielderckx

@emielderckx If you use JetBrains, are you able to confirm whether the TextMate grammar provided by language-mcfunction (mcfunction.tmLanguage) works out-of-the box with the plugin suggested by Martmists?

Arcensoth avatar Jan 09 '21 19:01 Arcensoth

@Arcensoth I think I got it to work, but I'm not sure of all functions work. I'm not to good with this, most jetbrains products are free so if you want to know if ever thing 100% works I'm afraid you need to test it for yourself

emielderckx avatar Jan 09 '21 21:01 emielderckx

I'll need to dig deeper into how the TextMate bundles work with Jetbrains and if it can be bundled in a separate plugin, but another approach would be to include it in the Minecraft Development plugin. This repo recently came up in the discussion for mcfunction support in minecraft-dev/MinecraftDev#615.

Native grammar support for JetBrains plugins is obviously not compatible with what is in this repo (example from Minecraft Development here) and without digging in I don't know how hard it would be to convert what is in this repo to native grammars - I suspect it would still be a good deal of work. The benefit of native implementation is the ability to implement autocomplete and inspections and such.

DenWav avatar Jan 11 '21 08:01 DenWav

@DemonWav Thanks for the information. I'll keep JetBrains on the list for potential future support, alongside highight.js and native SublimeText as others have requested in the past.

[...] I don't know how hard it would be to convert what is in this repo to native grammars - I suspect it would still be a good deal of work. The benefit of native implementation is the ability to implement autocomplete and inspections and such.

A similar task that I've entertained is to use the commands.json report (supplied by the vanilla server jar) to build a version-specific TextMate grammar that's accurate up to every command and argument. This grammar generator is incomplete and hasn't been worked on in some time, but once complete it could in theory be extended to build other types of grammars as well.

Arcensoth avatar Jan 11 '21 17:01 Arcensoth

Hi, for the new 2023.2 release of JetBrains IDEs, you can now use LSP API, this may simplify a lot this issue.

Ayfri avatar Aug 15 '23 14:08 Ayfri