asbjornenge / Docker.tmbundle

Dockerfile syntax
MIT License
75 stars 27 forks source link

Embed shellscript in the appropriate places #24

Closed rwols closed 2 years ago

rwols commented 6 years ago

I've been using this modified branch for a while now, and it works great for my purposes. Basically we include the shell script syntax where appropriate to get highlighting for RUN commands et al. Also, a part of the JSON syntax is included for things like ENTRYPOINT.

Here is a screenshot on how that looks:

schermafbeelding 2018-05-21 om 10 07 39
rwols commented 6 years ago

ping @asbjornenge

andyneff commented 6 years ago

@rwols, I like the idea, but what about other scenarios where bash is not the shell? One such example is windows containers...

rwols commented 6 years ago

@andyneff huh, I was not aware of running powershell statements in a Dockerfile. Let me change this this into an auxiliary syntax then.

rwols commented 6 years ago

Now there's two sublime-syntaxes, one for the "generic" case and one assuming bash. The bash one has no first line match, and has no files associated to it. So the generic one will always be used when opening a Dockerfile. However, users can override this (using "Open all with current extension as..." for example), or they can select this variant in the command palette.

asbjornenge commented 6 years ago

Hi!

Thanks for a great PR @rwols :tada: I'm currently on holiday in Spain (and will be for two more weeks), so limited time to reply and review. In general I really like the idea of highlighting the shell scripts syntax, but I'm not sure we should be adding assumptions like this into the repo, even if bash is the most common by far 🤔 Perhaps better that this exists as a separate fork and users can "opt in" by downloading and selecting it...?

I would gladly accept an updated README.md with links to useful forks :+1:

Thoughts @princemaple ?

princemaple commented 6 years ago

Had a quick look. Will do some digging before coming back to it. (On phone)

princemaple commented 5 years ago

@asbjornenge if @rwols is willing to maintain this version, it totally can live in this repo.

@rwols in our original version we highlight CMD and ENTRYPOINT a little differently to indicate that they are runtime commands. Your version seems to treat everything the same? Just an idea.

jrappen commented 5 years ago

Also Raoul, from_directive is unused in your syntax.

rwols commented 5 years ago

willing to maintain this version, it totally can live in this repo.

Sure, no problem. I'll keep an eye on the issues.

in our original version we highlight CMD and ENTRYPOINT a little differently to indicate that they are runtime commands. Your version seems to treat everything the same? Just an idea.

I'll have a look at it in the weekend.

asbjornenge commented 2 years ago

Should we merge this or what? I have not worked on this repo for years 😂

//cc @princemaple

princemaple commented 2 years ago

🤔 woah.

princemaple commented 2 years ago

This might be not as up-to-date as we'd hope today, but we can iterate on it.