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

Go to definition not working in Lean 4 repository #77

Closed
semorrison opened this issue Nov 16, 2021 · 3 comments
Closed

Go to definition not working in Lean 4 repository #77

semorrison opened this issue Nov 16, 2021 · 3 comments

Comments

@semorrison
Copy link
Contributor

semorrison commented Nov 16, 2021

To work on the Lean 4 repository in VSCode, we have to run elan override set to point to an appropriate toolchain.

This allows editing .lean files with server support, and go-to-definition (F12) works within a file.

Depending on which toolchain we use, go-to-definition may or may not work for definitions in imported files.
If we use a nightly, then go-to-definition works, but the .lean files that it jumps to are taken from .elan/toolchains, rather than the local build.

If we use a toolchain pointing to the local build, per the instructions

elan toolchain link lean4 build/release/stage1
elan override set lean4

then go-to-definition does not work at all across files.

@semorrison
Copy link
Contributor Author

Discussed on zulip here and here.

@gebner
Copy link
Member

gebner commented Nov 16, 2021

Local builds don't know where the sources are. There are several "solutions" for this:

  • Set the LEAN_SRC_PATH environment variable.
  • ln -s ~/lean4/src/ ~/lean4/build/release/stage1/lib/lean/

Ideally, they'd be able to figure out the source path automatically, but that's a lean4 issue not a vscode-lean4 one.

@gebner
Copy link
Member

gebner commented Dec 8, 2021

Sebastian fixed this by creating the src symlink in cmake.

@gebner gebner closed this as completed Dec 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants