Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve integration with others tools #312

Open
5 of 7 tasks
macabeus opened this issue Apr 11, 2020 · 9 comments
Open
5 of 7 tasks

Improve integration with others tools #312

macabeus opened this issue Apr 11, 2020 · 9 comments

Comments

@macabeus
Copy link

macabeus commented Apr 11, 2020

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 macabeus changed the title Add support for highlight editor Add support for highlight Apr 11, 2020
@macabeus macabeus changed the title Add support for highlight Improve integration with others tools Apr 11, 2020
@Pike
Copy link
Contributor

Pike commented Apr 12, 2020

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.

@tobias47n9e
Copy link

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

@macabeus
Copy link
Author

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.

@alerque
Copy link
Contributor

alerque commented Apr 13, 2020

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.

@macabeus
Copy link
Author

macabeus commented Aug 9, 2020

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

@rkh
Copy link

rkh commented Mar 26, 2021

Pull Request to add Fluent support to Rouge (which is used for syntax highlighting by tools like Jekyll and Middleman): rouge-ruby/rouge#1697

@alerque
Copy link
Contributor

alerque commented Mar 26, 2021

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.

@rkh
Copy link

rkh commented Jul 15, 2021

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: github-linguist/linguist#5341 – thanks @alerque.

@macabeus
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants