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

processing attribute #[path] of module #1499

Merged
merged 3 commits into from Jul 7, 2019

Conversation

@andreevlex
Copy link
Contributor

commented Jul 6, 2019

support two cases

  • simple name file foo.rs
  • declaration in mod.rs

#1211

@andreevlex andreevlex changed the title Feature/resolve path attr mod processing attribute #[path] of module Jul 6, 2019

@marcogroppo

This comment has been minimized.

Copy link
Contributor

commented Jul 6, 2019

Awesome! In theory this should enable completions for f32 and f64

@@ -364,6 +364,101 @@ fn module_resolution_works_for_raw_modules() {
"###);
}

#[test]
fn module_resolution_decl_path() {

This comment has been minimized.

Copy link
@matklad

matklad Jul 7, 2019

Collaborator

Lets move these and other tests that target specifically how mods are resoved into a new nameres/tests/mods.rs submodule?

This comment has been minimized.

Copy link
@andreevlex

andreevlex Jul 7, 2019

Author Contributor

Yes, of course

@matklad

This comment has been minimized.

Copy link
Collaborator

commented Jul 7, 2019

bors r+

Thanks!

bors bot added a commit that referenced this pull request Jul 7, 2019

Merge #1499
1499: processing attribute #[path] of module  r=matklad a=andreevlex

support two cases
- simple name file `foo.rs`
- declaration in mod.rs

#1211 

Co-authored-by: Alexander Andreev <andreevlex.as@gmail.com>
@bors

This comment has been minimized.

Copy link
Contributor

commented Jul 7, 2019

@bors bors bot merged commit 1c582be into rust-analyzer:master Jul 7, 2019

2 checks passed

bors Build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@andreevlex andreevlex deleted the andreevlex:feature/resolve-path-attr-mod branch Jul 7, 2019

@kjeremy

This comment has been minimized.

Copy link
Contributor

commented Jul 7, 2019

On rust-analyzer we went from:

Expressions of unknown type: 9603 (14%)
Expressions of partially unknown type: 3788 (5%)

to

Expressions of unknown type: 9599 (14%)
Expressions of partially unknown type: 3802 (5%)

@marcogroppo

This comment has been minimized.

Copy link
Contributor

commented Jul 7, 2019

I can confirm that RA can now display completions for f32 and f64 🎉 Unfortunately they are incomplete, because we don't look for the fXX_runtime lang items in libstd.

@andreevlex

This comment has been minimized.

Copy link
Contributor Author

commented Jul 8, 2019

@marcogroppo new issue?

@marcogroppo

This comment has been minimized.

Copy link
Contributor

commented Jul 8, 2019

@marcogroppo new issue?

I'll submit a PR!

bors bot added a commit that referenced this pull request Jul 8, 2019

Merge #1514
1514: Better completions for floating point primitive types r=flodiebold a=marcogroppo

After #1499 completions for (some of) the inherent methods of `f32` and `f64` are now working.
Unfortunately during method resolution we were only looking for the `f32` and `f64` language items defined in `libcore` and we were ignoring the methods defined in `libstd`.

This PR fixes this issue.

Co-authored-by: Marco Groppo <marco.groppo@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.