Closed matta closed 2 months ago
see what else that commit broke also: https://ci.appveyor.com/project/gyscos/cursive/builds/49884693/job/p3kn5kftd8rgveq3
it's kinda odd since it works locally, and the symlink is there examples -> ../examples/
Eh~~ I could very well revert that commit, since it didn't work as intended anyway.
Another way to put the examples in the root and still use a workspace is to give each example a working Cargo.toml. I saw this done in the velo repo, and verified that rust-analyzer works fine.
For example: https://github.com/linebender/vello/tree/9a98543c03c954732ac1dc202dd1181fbd515e36/examples/simple
Should be fixed now, feel free to re-open if you think you're still having this issue.
TLDR
Reverting the recent a9c0e46e97fa4342e017a481f9e5b7a2f9d490d0 commit fixes the issue. It appears that LSP functions when the "examples" directory is in the root of a crate, but not the root directory of a workspace.
Describe the bug
When I load any of cursive's examples/*.rs files in an editor, rust-analyzer is broken. It appears to not function, as if it were not source code.
This is true for VSCode, nvim, and helix. Seems to be a behavior of rust-analyzer itself and not the editor.
To Reproduce
Edit any of examples/*.rs files and try to do something like "Go to definition" of a Cursive API. It doesn't work.
Make an obvious typo edit in the file. No error is shown.
Expected behavior
Code navigation features, such as "Go to definition" function. This is a great way to explore a new package, so it would be nice if this worked.
Environment
Debian Linux in a recent git clone of https://github.com/gyscos/cursive
Additional context
Explicitly editing files with names examples/cursive/examples/*.rs does not work, so that doesn't appear to be an available workaround.