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

feat: use incrementality for completion in tactic blocks #5205

Merged
merged 3 commits into from
Sep 9, 2024

Conversation

mhuisi
Copy link
Contributor

@mhuisi mhuisi commented Aug 29, 2024

This PR enables the use of incrementality for completion in tactic blocks. Consider the following example:

example : True := by
  have : True := T
  sleep 10000

Before this PR, in order to respond to a completion request after T, sleep 10000 has to complete first since the command must be fully elaborated. After this PR, the completion request is responded to immediately.

@github-actions github-actions bot added the toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN label Aug 29, 2024
@leanprover-community-mathlib4-bot
Copy link
Collaborator

leanprover-community-mathlib4-bot commented Aug 29, 2024

Mathlib CI status (docs):

  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase 5c61ad38bec18056d97a7a0319af180fc3b3b703 --onto 9ce15fb0c61e3a1bee17fd81647ed4d02b4f6c6d. (2024-08-29 14:01:18)
  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase 5c61ad38bec18056d97a7a0319af180fc3b3b703 --onto d31066646dfa7389d818a2e2e1493be6a941924e. (2024-09-02 12:38:50)

@mhuisi mhuisi changed the title feat: use incrementality for tactic completion feat: use incrementality for completion in tactic blocks Aug 30, 2024
@mhuisi mhuisi marked this pull request as ready for review August 30, 2024 14:19
Comment on lines 39 to 40
-- such as a trailing dot after an option name. This shouldn't be a problem since any subsequent
-- command starts with a keyword that (currently?) does not participate in completion.
Copy link
Member

Choose a reason for hiding this comment

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

This doesn't seem to be true anymore as the subsequent syntax can now also be a tactic keyword and they do participate in completion

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I changed the implementation to use the syntax endpos now, which (I think) should not cause any issues.

@mhuisi mhuisi requested a review from Vtec234 as a code owner September 2, 2024 12:16
@mhuisi mhuisi added this pull request to the merge queue Sep 9, 2024
Merged via the queue into leanprover:master with commit ab7aed2 Sep 9, 2024
13 checks passed
@mhuisi mhuisi deleted the mhuisi/completion-incrementality branch September 9, 2024 12:31
tobiasgrosser pushed a commit to opencompl/lean4 that referenced this pull request Sep 16, 2024
…5205)

This PR enables the use of incrementality for completion in tactic
blocks. Consider the following example:
```lean
example : True := by
  have : True := T
  sleep 10000
```

Before this PR, in order to respond to a completion request after `T`,
`sleep 10000` has to complete first since the command must be fully
elaborated. After this PR, the completion request is responded to
immediately.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants