leanprover / lean4

Lean 4 programming language and theorem prover
https://lean-lang.org
Apache License 2.0
4.46k stars 388 forks source link

Syntax autocompletion #871

Open lovettchris opened 2 years ago

lovettchris commented 2 years ago

Prerequisites

Description

Since Lean syntax is extensible, there is no easy way to write it down or discover what is valid at any point in a Lean program. Therefore I propose we add a syntax element to the LSP for completion prompts. We could use different icons to represent "syntax" from "members".

Steps to Reproduce

image

Expected behavior:

show the user that the keyword "where" is allowed here.

Actual behavior:

it only shows 'members' of current namespaces...

Reproduces how often:

The problem is where is not documented in the theorem proving book, and our reference docs are very incomplete, so there is now way to know the where clause is valid here unless you go an read all the Lean compiler source code and new users shouldn't have to do that.

Versions

Lean (version 4.0.0-nightly-2021-12-13, commit 3a6cc774241b, Release)

Additional Information

Any additional information, configuration or data that might be necessary to reproduce the issue.

leodemoura commented 2 years ago

I marking this one as low priority based on the discussion at Zulip.