fluent icon indicating copy to clipboard operation
fluent copied to clipboard

Improve integration with others tools

Open macabeus opened this issue 4 years ago • 9 comments

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.

macabeus avatar Apr 11 '20 11:04 macabeus

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.

Pike avatar Apr 12 '20 16:04 Pike

GtkSourceview already has support for ftl files: https://gitlab.gnome.org/GNOME/gtksourceview/-/merge_requests/87

tobias47n9e avatar Apr 12 '20 18:04 tobias47n9e

I started a plugin for vscode: vscode-fluent

image

@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.

macabeus avatar Apr 12 '20 20:04 macabeus

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.

alerque avatar Apr 13 '20 10:04 alerque

@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. image

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?

macabeus avatar Aug 09 '20 20:08 macabeus

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

rkh avatar Mar 26 '21 14:03 rkh

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.

alerque avatar Mar 26 '21 14:03 alerque

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 avatar Jul 15 '21 07:07 rkh

@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:

macabeus avatar Jul 15 '21 11:07 macabeus