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

No completion on new file unless linked to the main.rs #7937

Closed
JDuchniewicz opened this issue Mar 9, 2021 · 5 comments
Closed

No completion on new file unless linked to the main.rs #7937

JDuchniewicz opened this issue Mar 9, 2021 · 5 comments

Comments

@JDuchniewicz
Copy link

I have no completion on a new .rs file unless I add a mod foo; to main.rs. I am running multiple buffers in vim and I open a new file with :e foo.rs and then save it.

@saiintbrisson
Copy link
Contributor

saiintbrisson commented Mar 9, 2021

This happens because rust-analyzer does not know where the file belongs if it is not specified in an existing module, and the file isn't always used in the package. I don't think this is an issue, could be wrong though.

@bjorn3
Copy link
Member

bjorn3 commented Mar 9, 2021

I believe there is an existing issue about improving this case, but I can't find it.

@saiintbrisson
Copy link
Contributor

saiintbrisson commented Mar 9, 2021

I believe there is an existing issue about improving this case, but I can't find it.

#6377 (comment) probably this one, but they only propose to warn when editing a file that is not in the hierarchy, and not to actually support them.

@flodiebold
Copy link
Member

Yes, #6377 plus also #6388 would help.

@JDuchniewicz
Copy link
Author

Sorry could not find it. Thanks for linking that though!

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

4 participants