Skip to content
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

Add intellisense for docker compose files #2539

Closed
10 of 14 tasks
bwateratmsft opened this issue Dec 3, 2020 · 15 comments
Closed
10 of 14 tasks

Add intellisense for docker compose files #2539

bwateratmsft opened this issue Dec 3, 2020 · 15 comments

Comments

@bwateratmsft
Copy link
Contributor

bwateratmsft commented Dec 3, 2020

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.

Maybe/currently not possible:

  • Semantic highlighting (I can't think of a use case)
  • Change the file picking logic to be better and language-based (I don't think currently possible)
  • Port-in-use intellisense (Gross, port scanning)

Other:

Update: as of 2 Aug 21, about 33% of activations are due to Dockerfiles being opened, now about 25% are due to Docker Compose files being opened, with most of the balance being task runs and the Docker Explorer. This is down from 60% YAML, 30% Dockerfile, 10% others. This is a big improvement; by narrowing to activating for Compose documents only, the activations for Compose/YAML are way lower--this means far less spurious activation.

@ucheNkadiCode
Copy link
Contributor

ucheNkadiCode commented Dec 5, 2020

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:

  • env
  • env_file
  • build
  • depends_on
  • labels

@dbreshears dbreshears added this to the 1.11.0 milestone Dec 15, 2020
@dbreshears dbreshears added the P2 label Dec 15, 2020
@thernstig
Copy link
Contributor

@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) or compose.yml in working directory. Compose implementations SHOULD also support docker-compose.yaml and docker-compose.yml for 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
Copy link
Contributor Author

bwateratmsft commented Jan 12, 2021

@bwateratmsft should the docker-stack.yml be scrapped?

Yeah, probably. 😄

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) or compose.yml in working directory. Compose implementations SHOULD also support docker-compose.yaml and docker-compose.yml for 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.

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.

@bwateratmsft
Copy link
Contributor Author

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.

@rcjsuen
Copy link
Contributor

rcjsuen commented Jan 29, 2021

@bwateratmsft Is the plan to implement this with VS Code APIs or as a language server? 🤔

@bwateratmsft
Copy link
Contributor Author

bwateratmsft commented Feb 1, 2021

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. 😄

@bwateratmsft
Copy link
Contributor Author

Might get a language ID from VSCode itself: microsoft/vscode#118042

@dbreshears dbreshears modified the milestones: 1.11.0, 1.12.0 Mar 3, 2021
@bwateratmsft
Copy link
Contributor Author

bwateratmsft commented Aug 31, 2021

The pink whale icon has been extended to all dockercompose documents via microsoft/vscode@5541826. This should be available in VSCode 1.60 or maybe 1.61.

@bwateratmsft
Copy link
Contributor Author

Moving milestone to 1.19.0 as we have completed what we wanted to in 1.18.0.

@bwateratmsft bwateratmsft modified the milestones: 1.18.0, 1.19.0 Nov 8, 2021
@bwateratmsft bwateratmsft modified the milestones: 1.19.0, 1.20.0 Nov 17, 2021
@bwateratmsft bwateratmsft modified the milestones: 1.20.0, 1.21.0 Jan 20, 2022
@bwateratmsft
Copy link
Contributor Author

Rather than continually moving this a milestone at a time, I'm going to make sure issues exist for each of the remaining tasks in https://github.com/microsoft/compose-language-service, and close this one.

@thernstig
Copy link
Contributor

@bwateratmsft the original post in this thread already contains existing issues. Just open them up again?

@bwateratmsft
Copy link
Contributor Author

Yeah, that's a better idea. I'll do that and transfer them to the other repo.

@bwateratmsft bwateratmsft removed their assignment Jan 26, 2022
@bwateratmsft bwateratmsft removed this from the 1.21.0 milestone Jan 26, 2022
@microsoft microsoft locked and limited conversation to collaborators Mar 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants
@dbreshears @karolz-ms @rcjsuen @ucheNkadiCode @thernstig @bwateratmsft and others