amber-lang / amber

💎 Amber the programming language compiled to Bash
https://amber-lang.com
GNU General Public License v3.0
3.86k stars 82 forks source link

✨ JetBrains IDEs plugin? #85

Open kaplan-michael opened 4 months ago

kaplan-michael commented 4 months ago

Hey, I wanted to ask if you plan a plugin for syntax highlighting, etc. for JetBrains IDEs? similar to what's available for vscode?

halirutan commented 4 months ago

To implement this, it would be beneficial if there was a formal description of the Amber language that goes beyond the regex available in the VSCode plugin. The reason is that a JetBrains plugin requires to re-implement the parser in Kotlin/Java. So if a BNF or a clear documentation about tokens, precedences, parsing rules, etc was available, a JetBrains plugin could provide not only syntax highlighting but

However, working on a plugin without help from the maintainers who provide up-to-date information about syntax is really painful and error-prone.

asm0dey commented 4 months ago

@halirutan funny to meet you in such an unusual place :)

If we're speaking about the basic support, it can be borrowed from basically any open source language plugin (is bash support open source?).

But surely having a formal grammar would help a lot to implement a proper support with https://github.com/JetBrains/Grammar-Kit

Ph0enixKM commented 4 months ago

This is also required for the Zed IDE that I'm currently using. I think that once the language becomes more stable and mature, we can invest our time in formally documenting the parsing rules in the official documentation. However, to avoid leaving you empty-handed, I'll prepare some basic BNF that we can expand on as we move forward.

Ph0enixKM commented 4 months ago

I've added EBNF language grammar in this issue https://github.com/Ph0enixKM/Amber/issues/100 (merged already - we can iterate on this). If you find any errors, please create an issue on it so I can clarify any confusion

folliehiyuki commented 3 months ago

For syntax highlighting to work in Zed (and also in other text editors like Neovim/Emacs/Helix), a tree-sitter parser for Amber should be implemented.

Ref: https://tree-sitter.github.io/tree-sitter/creating-parsers