zed
zed copied to clipboard
Add syntax highlighting and LSP for Dockerfiles
Looks like it could resolve #5311 ? I haven't messed with any docker-compose stuff but seeing as that is YAML based and there is already YAML support this should address the Dockerfile syntax highlighting and LSP support.
I'm also a Rust newbie so if there is anything that looks off please do let me know!
A screenshot showing syntax highlighting when running via cargo run:
Release Notes:
- Added syntax highlighting and LSP for Dockerfiles
We require contributors to sign our Contributor License Agreement, and we don't have @everettraven on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'.
@cla-bot check
The cla-bot has been summoned, and re-checked this pull request!
Awesome, but I noticed that the syntax after PREFIX(run. etc) doesn't seem to be highlighted, I'm very impressed by the vscode plug-in, can you help me take a look: https://marketplace.visualstudio.com/items?itemName=jeff-hykin.better-dockerfile-syntax
This looks close to be done, so it would be great to add a new docs entry to the https://github.com/zed-industries/zed/tree/main/docs/src/languages list before merging.
Awesome, but I noticed that the syntax after PREFIX(run. etc) doesn't seem to be highlighted, I'm very impressed by the vscode plug-in, can you help me take a look: https://marketplace.visualstudio.com/items?itemName=jeff-hykin.better-dockerfile-syntax
@d1y I updated the tree-sitter highlighting to get as close to this as I could. The new highlighting looks like this:
There is variable expansion highlighting where possible but there are some limitations as the tree-sitter-dockerfile crate doesn't currently have support for expansion in certain instructions (one is the RUN instruction) and no shell command syntax highlighting (it was either the whole shell command is highlighted or none, although this limitation could be due to me being more novice in messing with this tooling). That being said, I think this PR is "good enough" as is regarding the syntax highlighting and it could be incrementally improved in the future.
This looks close to be done, so it would be great to add a new docs entry to the https://github.com/zed-industries/zed/tree/main/docs/src/languages list before merging.
@SomeoneToIgnore Thanks for pointing that out! Rebased and added!
@maxdeviant @SomeoneToIgnore Anything else needed to get this merged?
This needs a rebase, but otherwise I see no blocking issues, the comments are welcome to be fixed in follow-up PRs.
Do you have any further questions about this PR? Can we merge? I really need this
Can we merge?
Would be nice, but GH does not allow this for the PRs with conflicts. Neither can I push into the branch, so one small step has to be done by somebody.
https://github.com/zed-industries/zed/pull/6905#issuecomment-1921258868
https://github.com/zed-industries/zed/pull/7977 made that happen thanks to @d1y , hence closing this stale one.
@d1y Thanks for taking this over! I had some stuff come up and wasn't able to circle back around to address the comments/conflicts :(. Awesome to see this work get in!
