zed
zed copied to clipboard
Add OCaml support
👋
This pull request implements support for the OCaml Language.
Additions
- [x] tree-sitter-ocaml grammar
- [x] Highlight, Indents, Outline queries
- [x] A new file icon for .ml(i) files. Based on ocaml/ocaml-logo
- [x] LSP Integration with ocaml-language-server
- [x] Completion Labels
- [x] Symbol Labels
Bug Fixes
- [x] Improper parsing of LSP headers.
Missing [will file a separate issue]
- Documentation on completionItem, requires:
completionItem/resolvewith support fordocumentationas a provider.
Screenshots
Zed
Release Notes:
- Added OCaml Support (#5316).
[!NOTE] Partially completes #5316 To complete #5316:
- addition of a reason tree-sitter grammar.
- opam/esy integration, however it may be better as it's own plugin.
We require contributors to sign our Contributor License Agreement, and we don't have @huwaireb 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!
I've pushed a commit to handle Content-Type, the change felt too small for a new PR. The LSP should work fine now.
Hello, could you also add a docs entry please, into the https://github.com/zed-industries/zed/tree/main/docs/src/languages list.
rebased, should be ready now 🪷
I'm curious if it's fine for me to document use instructions across different package managers (nix/esy/opam) in thedocs/src/languages/ocaml.md?
The lack of direct support for the officially supported package manager (opam) would require a similar workflow to using Nix with any other language. That is, opening Zed from a terminal where your active project sandbox (switch) is activated with ocamllsp installed.
I would've loved to implement it into Zed to make it more seamless, but I guess that would set precedent for other "obscure" languages that it's fine, as opposed to going through the soon to be plugin route.
Go test started to fail after a different commit in main and I'll check that, but this PR has nothing to do with it, optimistically merging.
Thank you for the fixes!