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

✨ Added coq support #12202

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

HiiGHoVuTi
Copy link

Only added the lsp support as I found no grammar.
I am open to suggestions, as this is my first time adding a language to Helix and I'm no coq expert.
I ran tests locally and updated the documentation.

Only added the lsp support as I found no grammar
Copy link
Member

@the-mikedavis the-mikedavis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than adding a language entry for this let's recommend it in the language server configs wiki: https://github.com/helix-editor/helix/wiki/Language-Server-Configurations

We generally don't accept languages that are language-server configurations only and the "v" file-type will conflict with vlang and verilog

@kirawi kirawi added A-language-server Area: Language server client S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 19, 2025
@edwintorok
Copy link

Based on this I added the following entry to my ~/.config/helix/languages.toml:

[language-server.coq-lsp]
command = "coq-lsp"

[[language]]
name = "coq"
scope = "source.v"
file-types = ["v"]
block-comment-tokens = { start = "(*", end = "*)" }
language-servers = [ "coq-lsp" ]
indent = { tab-width = 2, unit = "  " }

And this gets some basic support working (no syntax highlighting though!).

However looking at coq-lsp it supports quite a few extensions to the LSP protocol that are useful when working with proofs: https://github.com/ejgallego/coq-lsp/blob/main/etc/doc/PROTOCOL.md#extensions-to-the-lsp-specification
I think the extensions would have to be implemented by Helix (or as a Helix plugin if/when Helix supports them)

For syntax highlighting would semantic tokens (once implemented ejgallego/coq-lsp#854 (comment)) work, or would a tree-sitter grammar be needed?
I only see this grammar: https://github.com/ejgallego/coq-lsp/blob/main/editor/code/syntaxes/coq.json and I'm not sure if that can be converted into something that Helix could use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-language-server Area: Language server client S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants