dockstore / dockstore

An app store for scientific workflows, tools, notebooks, and services
https://dockstore.org/
Apache License 2.0
119 stars 27 forks source link

Syntax highlighter for WDL respects the Irish, but disrespects WDL syntax #3993

Open aofarrel opened 3 years ago

aofarrel commented 3 years ago

Is your feature request related to a problem? Please describe. After filling a ticket for #3984 I decided to check if this also exists in WDL because I forgot the WDL equivalent has to be within a string so apostrophes are non-issue. But, I noticed that syntax with the command section did not have highlighting, unlike the other sections.

In WDL, this is a valid way to form a command section and what is shown in most tutorials aimed at beginners:

command {
    foo
}

However, this syntax is a pain in certain circumstances if you're using variables. For this reason, in WDL 1.0, this is also valid syntax for a command section:

command <<<
    foo
>>>

It appears that, in Dockstore, the <<>> format isn't supported by the syntax highlighter and everything within it is just white. This is different from, say, the output section, where the string in the following section is green, the equals sign is orange, etc.

Describe the solution you'd like Ideally, at least in the simple case when the command section just contains standard bash stuff, syntax should be highlighted within that section. The command section is usually the most complicated part of a WDL, so having a syntax highlighter that skips it entirely is not very useful to WDL users.

Describe alternatives you've considered Perhaps it could be toggled by the user to emphasize that what's within the command section is a different kind of syntax then what's outside of it, or use different colors, or just be a single block of its own unique color, or...

Additional context There's really two ways I think this can be scoped -- either having the syntax highlighter only highlight the more simple cases, like this... Screenshot_2020-12-23 Dockstore Workflow

...or to also support situations where you have other languages. Screenshot_2020-12-23 Dockstore Workflow(1)

Both of these screenshots are from the TopMed Variant Caller WDL.

┆Issue is synchronized with this Jira Story ┆Fix Versions: Dockstore 2.X ┆Issue Number: DOCK-1683 ┆Sprint: Backlog ┆Issue Type: Story

melainalegaspi commented 3 years ago

This should be an issue for a particular repo. @garyluu fill in the name of the repo.

garyluu commented 3 years ago

// WDL Grammar generated originally from the tmLanguage of https://github.com/broadinstitute/wdl-sublime-syntax-highlighter using https://github.com/ajaxorg/ace/wiki/Importing-.tmtheme-and-.tmlanguage-Files-into-Ace#importing-textmatesublime-languages