language-docker icon indicating copy to clipboard operation
language-docker copied to clipboard

Suggested instruction to have syntax highlighting for Dockerfiles.<suffix> doesn't work

Open zedtux opened this issue 7 years ago • 3 comments

I have installed the file-types package in Atom and changed as suggested the config.cson file but my Dockerfile.ci is not highlighted.

As I noticed the ^ at the very beginning of the instruction, and as my file is in sub folders I did tried the following :

  "file-types":
    "**/Dockerfile\\..*$": "source.dockerfile"

But it is still not working (and I tried many times to restart Atom), so it looks like this is no more working.

Can you please help me?

zedtux avatar Jan 11 '19 13:01 zedtux

Oaky actually with the following it is working :

  "file-types":
    "**/Dockerfile.*": "source.dockerfile"

zedtux avatar Jan 11 '19 13:01 zedtux

In order to make all cases working (Dockerfile, Dockerfile. and some/where/in/the/src/Dockerfile.) :

  "file-types":
    "**/Dockerfile.*": "source.dockerfile"
    "Dockerfile.*": "source.dockerfile"

So I guess an update of the instructions with this should fix the issue.

zedtux avatar Jan 11 '19 13:01 zedtux

I'm adding a solution based on specifying exact file names. In current Atom 1.55.0-nightly0 (from 7 Nov 2020), the following code from config.cson works:

"*":
  core:
    customFileTypes:
      "source.dockerfile": [
        "Dockerfile.test"
        "Dockerfile.abc"
      ]

for assigning the source.dockerfile grammar to Dockerfile.test and Dockerfile.abc files.

TrinityCoder avatar Dec 29 '20 06:12 TrinityCoder