cylc / Cylc.tmbundle

TextMate bundle for the Cylc language (for TextMate, PyCharm, WebStorm, Sublime)
BSD 3-Clause "New" or "Revised" License
1 stars 2 forks source link

Cylc TextMate Bundle #1

Closed oliver-sanders closed 4 years ago

oliver-sanders commented 4 years ago

A language bundle for:

kinow commented 4 years ago

Diff:

diff --git a/Syntaxes/cylc.tmLanguage b/Syntaxes/cylc.tmLanguage
index a2d9292..de688f4 100644
--- a/Syntaxes/cylc.tmLanguage
+++ b/Syntaxes/cylc.tmLanguage
@@ -4,6 +4,10 @@
 <dict>
        <key>name</key>
        <string>cylc</string>
+        <key>fileTypes</key>
+        <array>
+                <string>rc</string>
+        </array>
        <key>patterns</key>
        <array>
                <dict>

Then removed, added back to WebStorm, and loaded a suite I used recently in a PR for cylc-admin.

image

Looking great! :rocket:

kinow commented 4 years ago

(random thought too: maybe there is a way to create a JS app for this syntax? If so, we could have an online syntax highlight for Cylc suites, maybe deployed to GitHub pages or Netlify; even though there are IDE and editors that support syntax, some users may want to just read some suite they have without installing anything—there are tools like this for HTML, Java, Prolog, etc)

oliver-sanders commented 4 years ago

Diff:

Yes ATM you have to tell your editor to use this syntax explicitly, this needs to be fixed in the text mate grammar itself. Note that using the .rc extension isn't ok because it will override default .rc behaviour.

maybe there is a way to create a JS app for this syntax?

Hopefully yes - https://github.com/cylc/cylc-ui/issues/144

kinow commented 4 years ago

Yes ATM you have to tell your editor to use this syntax explicitly, this needs to be fixed in the text mate grammar itself. Note that using the .rc extension isn't ok because it will override default .rc behaviour.

:+1: I will look into how to set the extension in WebStorm then (I know I can do that with Eclipse, no idea with WebStorm).

oliver-sanders commented 4 years ago

I think we will associate *suite.rc files with the grammar in a future commit.

kinow commented 4 years ago

I think we will associate *suite.rc files with the grammar in a future commit.

That would be helpful. At the moment in WebStorm the .rc extension has no association, and opens with the default text editor. But *suite.rc would probably work for WebStorm and for users that have already .rc associated with other editors/bundles.