-
Notifications
You must be signed in to change notification settings - Fork 522
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Recognize Dockerfile.* #1907
Comments
At present this is intentional. Our patterns include Our concern with You can locally override this behavior with a setting in either user or workspace settings.json: "files.associations": {
"Dockerfile.*": "dockerfile"
} Using this option will allow for both syntax highlighting and the right-click -> Build Image (or, Build Image from command palette) commands. |
Understood, I totally see how that can be a problem. Perhaps this ticket could be expanded to provide a feature that allows users to specify inclusions and exclusions (with a wildcard accepted) where exclusions take priority. With such a feature you could define include: Dockerfile.* and exclude: Dockerfile.js, Dockerfile.cs etc. I feel like it's quite common to use the |
Exclusions would require a change from VSCode itself. However, I'm going to try to find out if |
Understood. The .cs association sounds like a good idea! I wonder if file associations have some precedence ordering? I guess that'll be included in your query. |
I tried it out.
{
"files.associations": {
"*.cs": "csharp"
}
}
This behavior is good. I haven't researched yet how widespread this |
@BigMorty @chrisdoherty4 I looked at VSCode's telemetry some. It's not an exact science; Dockerfiles are detected based on MIME type and all we know is the file extension, not name. Here's some data on the antipattern usage (last 30 days, limit 100K samples). I looked for any recognizable not-Dockerfile-extension (21 total):
(that .cs might have been us 😄) In contrast here's the top 20. We cover the first six rows (64102 total), but miss everything else (132 total):
Given that users can override the default with a file association so that their not-Dockerfile is treated as a not-Dockerfile, it seems to me that we should change to |
We discussed this in a meeting and decided to go ahead and make the change, given the data clearly supports it. |
Amazing! love that you brought data to the conversation. |
@chrisdoherty4 Roughly monthly; 1.1.0 just released a few days ago...so about a month? (no promises!) |
This change is now available in version 1.2.0 of the Docker extension. |
I'm using vscode-docker v1.1.0 with VSCode 1.44.2 and it doesn't seem to recognise Dockerfile.* files. An issue was raised at microsoft/vscode#38797 (albeit years ago) suggesting it is a feature so I think this is either a bug or there is some setting I haven't found yet that needs turning on?
The text was updated successfully, but these errors were encountered: