You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Today the contributes.languages feature allows for matching on filenames, extensions, MIME types, and first lines. In the Docker extension we recently decided to treat Dockerfile.* as a Dockerfile. We saw a very long tail of users with different extensions--e.g. Dockerfile.develop, Dockerfile.amd64, Dockerfile.myapp, etc.--too many to practically list out individually in our package manifest. So we changed it to Dockerfile.* so we could cover all of those users.
This approach made it so our extension had the right file association in about 80% of cases, whereas before we covered more like 20%. However, there are some relatively common examples--e.g. Dockerfile.go--that are not Dockerfiles. In these situations we're incorrect. Since the number of common filenames that aren't Dockerfiles seems to be relatively small, we thought it would be nice to be able to add exceptions to the Dockerfile.* rule.
The text was updated successfully, but these errors were encountered:
Hi, guys. I'm not so sure about this feature request.
First, the file extension is the top priority when detecting a file type. It's a rule which we shouldn't break. If vscode treats a Dockerfile.go or Dockerfile.js as a Dockerfile, it will cause confusions for some developers (like me, as shown on microsoft/vscode-docker#2128) . it looks like a bug not a feature.
Second, the Dockerfile has a relatively simple format which most developers can write a Dockerfile correctly without a formatter. Docker extension of vscode is doing well now, there is no need to cover all possibility, especially with the cases of mistaken identity.
I know @bwateratmsft was devoted to find a better solution for this, but I have to vote no before a better solution.
Today the
contributes.languages
feature allows for matching on filenames, extensions, MIME types, and first lines. In the Docker extension we recently decided to treatDockerfile.*
as a Dockerfile. We saw a very long tail of users with different extensions--e.g.Dockerfile.develop
,Dockerfile.amd64
,Dockerfile.myapp
, etc.--too many to practically list out individually in our package manifest. So we changed it toDockerfile.*
so we could cover all of those users.This approach made it so our extension had the right file association in about 80% of cases, whereas before we covered more like 20%. However, there are some relatively common examples--e.g.
Dockerfile.go
--that are not Dockerfiles. In these situations we're incorrect. Since the number of common filenames that aren't Dockerfiles seems to be relatively small, we thought it would be nice to be able to add exceptions to theDockerfile.*
rule.The text was updated successfully, but these errors were encountered: