fluent
fluent copied to clipboard
Improve integration with others tools
Would be very useful to add support for highlight at others tools, such as vscode and github.
I'm creating this "meta issue" mainly to track the progress and know if someones already started that before. I looked before on others repositories but I didn't before, I'm sorry if it's a repeated issue.
On play we are using Ace with fluent
mode but there is no mode with that name.
To add support to GitHub we should firstly add support to Ace and so update this file. Would be nice also add support to CodeMirror, to be able to have syntax highlighting while editing the file on web.
VS Code (and probably others editors) uses TextMate syntax.
- [ ] ace
- [x] github
- [x] vscode
- [ ] code mirror
- [x] vim
- [x] GtkSourceview
- [x] Rogue
For ace/github, we'll need to see what the conflicts over the file extension .ftl
means.
Are there other extensions with multiple modes already?
There's a starting point for Atom, too, https://github.com/tree-sitter/tree-sitter-fluent.
For VSCode, it's a bit sad that doing support for VSCode doesn't mean we get support for the Monaco editor.
GtkSourceview already has support for ftl
files: https://gitlab.gnome.org/GNOME/gtksourceview/-/merge_requests/87
I started a plugin for vscode: vscode-fluent
@Pike Atom also support for TextMate syntax: https://flight-manual.atom.io/hacking-atom/sections/creating-a-legacy-textmate-grammar/ (despite that it's legacy)
If someone want to add support to Atom, could use as start point the code that I already wrote on vscode-fluent.
Regarding Linguist (and hence GitHub / GitLab / Ace / Etc.), the conflict with *.ftl
being used by FreeMarker and Fluent has been reported on their issue tracker before but they haven't been real helpful so far citing lower Fluent usage and hence closing issues related to disambiguating them. It does look like they might be open to a PR, but it would need to add both Fluent support and a heuristic for determining what any random FTL file is likely to be. They also require at least "hundreds" of GitHub repositories using the file type in the wild as a minimum bar.
@Pike Hey, I'm developing the Fluent extension for vscode, and I would like to use Fluent's logo on the extension, to display on vscode's marketplace.
But since Fluent uses Apache License, its trademarks are limited and I need an authorization from someone to use the logo. Could you help me to do that, please? I need to send an email to Mozilla or post on some forum?
Pull Request to add Fluent support to Rouge (which is used for syntax highlighting by tools like Jekyll and Middleman): https://github.com/rouge-ruby/rouge/pull/1697
Since my previous comment, GitLab has switched from linguist to Rouge, so the PR @rkh mentions should bring partial support there too! Unfortunately their Web IDE uses Monaco, which has syntax highlighting via Monarch.
FWIW it looks like GitHub now highlights ftl files and also allows fluent
in GFM code blocks:
# Simple things are simple.
hello-user = Hello, {$userName}!
# Complex things are possible.
shared-photos =
{$userName} {$photoCount ->
[one] added a new photo
*[other] added {$photoCount} new photos
} to {$userGender ->
[male] his stream
[female] her stream
*[other] their stream
}.
This seems to have done the trick: https://github.com/github/linguist/pull/5341 – thanks @alerque.
@rkh Thanks!
Reading the PR, I noticed that they are using the grammar that I wrote on vscode-fluent
! I'm happy to know that my grammar will be more used :smile: