Creating this umbrella issue since there are a bunch of different things that basically boil down to creating a language server + intellisense + etc. for compose files.
file.associations (#206)docker-compose.yml and docker-compose.override.yml)onLanguage:yaml accounts for about 60% of all our activations; I'm sure many (or most) of those are not actually docker-compose filesdocker-stack.yml (#520)
Other Notes & Ideas:
Adding a "well known" service to a compose file through a snippet. (Redis, postgres)
Warnings for incorrect indentation levels of a service or attributes (e.g "attribute dockerfile does not exist at this hierarchy)
Warnings for incorrect file paths or files that don't exist in the context of the project - mainly applies to context attribute and volume attribute
Warnings for misspelled sections (if you misspell volumes, ports, environment etc, there are no warnings)
Feb 11th Edit (per our meeting discussions):
We have at least a few sections we want to tackle early on for creating tab completions. A few of them are listed below:
@bwateratmsft should the docker-stack.yml be scrapped?
According to https://github.com/compose-spec/compose-spec/blob/master/spec.md#compose-file and https://docs.docker.com/compose/compose-file/ - the latest specs says a file should be named compose.yaml it says:
The default path for a Compose file is
compose.yaml(preferred) orcompose.ymlin working directory. Compose implementations SHOULD also supportdocker-compose.yamlanddocker-compose.ymlfor backward compatibility.
I also noticed now that when I renamed my file to compose.yaml it does not get the "red Moby Dick icon" but rather a normal .yaml icon.
@bwateratmsft should the
docker-stack.ymlbe scrapped?
Yeah, probably. :smile:
According to https://github.com/compose-spec/compose-spec/blob/master/spec.md#compose-file and https://docs.docker.com/compose/compose-file/ - the latest specs says a file should be named
compose.yamlit says:The default path for a Compose file is
compose.yaml(preferred) orcompose.ymlin working directory. Compose implementations SHOULD also supportdocker-compose.yamlanddocker-compose.ymlfor backward compatibility.I also noticed now that when I renamed my file to
compose.yamlit does not get the "red Moby Dick icon" but rather a normal.yamlicon.
I had not noticed this change, thank you for bringing it to our attention! I'm going to make a separate work item (#2618) to cover that for the time being. It is more urgent that we get that fix in place than that we create a compose language server.
We will be able to do this incrementally which is good. The minimum viable product would include a language ID being defined, and syntax highlighting to support it. This would have the side benefit of reducing spurious activations for non-compose YAML files.
@bwateratmsft Is the plan to implement this with VS Code APIs or as a language server? 馃
Most likely a language server since I assume a lot of these features would require that. We also want to take the same language server and run it in VS--not just VSCode--which is a thing now, or so I'm told. :smile:
Might get a language ID from VSCode itself: https://github.com/microsoft/vscode/pull/118042
The VSCode team has merged that change, so now there is a compose language ID of dockercompose. It matches the following patterns:
"filenamePatterns": [
"compose.yml",
"compose.yaml",
"compose.*.yml",
"compose.*.yaml",
"*docker*compose*.yml",
"*docker*compose*.yaml"
],
I'll start making some changes in the Docker extension to best support this. Thanks @alexr00! This is a big win for us!
Moved to 1.17 per discussion in team meeting, and we'll make this high pri for 1.17.
Most helpful comment
The VSCode team has merged that change, so now there is a compose language ID of
dockercompose. It matches the following patterns:I'll start making some changes in the Docker extension to best support this. Thanks @alexr00! This is a big win for us!