coq-community / vscoq

A Visual Studio Code extension for Coq [maintainers=@rtetley,@huynhtrankhanh,@thery,@Blaisorblade]
MIT License
334 stars 68 forks source link
coq editor vscode vscode-extension vscodium

CI Contributing Code of Conduct Zulip

VsCoq is an extension for Visual Studio Code (VS Code) and VSCodium which provides support for the Coq Proof Assistant.

VsCoq is distributed in two flavours:

Supported Coq versions

VsCoq supports all recent Coq versions >= 8.18.

Installing VsCoq

To use VsCoq, you need to (1) install the VsCoq language server and (2) install and configure the VsCoq extension in either VS Code or VSCodium.

Installing the language server

After creating an opam switch, pin Coq, and install the vscoq-language-server package:

$ opam pin add coq 8.18.0
$ opam install vscoq-language-server

After installation, check that you have vscoqtop in your shell and note the path to this executable:

$ which vscoqtop

Pre-release versions

We often roll out pre-release versions. To get the correct language server version please pin the git repo. For example, for pre-release v2.1.5:

$ opam pin add vscoq-language-server.2.1.5  https://github.com/coq-community/vscoq/releases/download/v2.1.5/vscoq-language-server-2.1.5.tar.gz

Installing and configuring the extension

To install the VS Code or VSCodium extension, first run code or codium. Then press F1 to open the command palette, start typing "Extensions: Install Extension", press enter, and search for "vscoq". Switch to the pre-release version of the extension and enable it. Finally, go to the extension settings and enter the vscoqtop full path from above in the field "Vscoq: Path".

If you want asynchronous processing of Coq files, you can go to the "Proof: Mode" and select "Continuous". Otherwise, processing will step by step and top-down as in VsCoq1.

Pre-release versions

In VsCode, from the extensions page, either use the drop down menu from the Uninstall button and select Install another version, or click on Switch to pre-release.

Troubleshooting

Known problems

Getting help

If you are unable to set-up vscoq, feel free to contact us on the Vscoq devs and users channel in zulip.

Features

The new version of vscoq allows users to opt for continuous checking, see the goal panel update as you scroll or edit your document.

By default vscoq is configured to use classic step by step checking mode.

Users can choose their preferred display mode, see goals in accordion lists...

... Or organized in tabs.

We now support a dedicated panel for queries. We currently support Search, Check, About, Locate and Print with plans to add more in the future.

We also support inline queries which then trigger messages in the goal panel.

Since version 2.1.7

We now support a document outline, which displays theorems and definitions in the document.

Goals can now be ellided. First through the "vscoq.goals.maxDepth" setting which ellides a goal if the display becomes to large. Finally by clicking on the goal view as showcased here. The following modifiers can be used:

We have added support for quickfixes. However, quickfixes rely on some Coq API which will only make it in the 8.21 release. Developpers are encouraged to list and add their own quickfixes in the Coq source code.

We support the classic block on error mode, in which the execution of a document is halted upon reaching an error. This affects both checking modes (Continuous and Manual). A user can opt out of this execution mode by setting it to false in the user settings.

Settings

After installation and activation of the extension:

(Press F1 and start typing "settings" to open either workspace/project or user settings.)

Coq configuration

Memory management (since >= 2.1.7)

Goal and info view panel

Proof checking

Code completion (experimental)

Diagnostics

For extension developers

See Dev docs

Maintainers

This extension is currently developed and maintained as part of Coq Community by Enrico Tassi, Romain Tetley.

VsCoq Legacy is no longer actively developed but is still maintained for compatibility purposes. It was developed and maintained by Maxime Dénès, Paolo G. Giarrusso, Huỳnh Trần Khanh, Laurent Théry, and contributors.

License

Unless mentioned otherwise, files in this repository are distributed under the MIT License.

The files client/syntax/coq.tmLanguage and client/coq.configuration.json are also distributed under the MIT License, Copyright (c) Christian J. Bell and contributors.