How to use Dockerfile syntax highlight with `Dockerfile.production` and `Dockerfile.staging`

Hi there, I'm using Docker to setup a private image. The image will have different version based on the environment. To achive this workflow I've named the Dockerfile for production environment `Dockerfile.production` but I could not find the proper Docker syntax highlight. Maybe it's just not named Docker, but it's taken from anbother syntax highligher. I don't know.

Does anyone know how to get Dockerfile syntax highlight on the `Dockerfile.production` and `Dockerfile.staging`?

7

Try adding both names to the list of patterns registered for Dockerfile file type in Settings | Editor | File Types:

 

11
Avatar
Permanently deleted user

Amazing. It was exactly what I was looking for, just didn't know where it was. Thanks!

1

Btw why do this rule not working for highlighting in some cases?

1

@Alex

Check entries for "Text" file type -- you may have an exact match entry there already... if so -- remove it.

1

In version 2021.1.2 there is no Dockerfile type in Settings | Editor | File Types. Was it removed?

0

@Marcin

It is there for me in PhpStorm 2021.1.3

Make sure that Docker plugin is enabled. If that plugin is disabled then the File Type entry is absent.

3

@Andriy

Make sure that Docker plugin is enabled. If that plugin is disabled then the File Type entry is absent.

You are right, I missed that part. Thanks!

0

请先登录再写评论。