Skip to content

Failed to resolve module name with raw name #1211

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

Closed
max-frai opened this issue Apr 26, 2019 · 7 comments
Closed

Failed to resolve module name with raw name #1211

max-frai opened this issue Apr 26, 2019 · 7 comments
Labels
E-easy E-has-instructions Issue has some instructions and pointers to code to get started good first issue

Comments

@max-frai
Copy link
Contributor

I have file/module with name match and rust-analyzer fails to find it:

изображение

@ava57r
Copy link
Contributor

ava57r commented Jun 20, 2019

some problem.

@matklad matklad added E-easy E-has-instructions Issue has some instructions and pointers to code to get started good first issue labels Jun 20, 2019
@matklad
Copy link
Member

matklad commented Jun 20, 2019

Some pointers:

The relevant function is here:

https://github.com/rust-analyzer/rust-analyzer/blob/cd1ff2e2a11dd781e051060c650537802dfbbe99/crates/ra_hir/src/nameres/collector.rs#L634-L666

It doesn't handle raw identifiers and #[path] attributes, but it should be possible to add. The inputs to this function are from ModuleData struct. So, when we construct ModuleData, we should pay a closer attention to raw identifiers and attributes

@matklad
Copy link
Member

matklad commented Jun 20, 2019

ava57r added a commit to ava57r/rust-analyzer that referenced this issue Jul 3, 2019
bors bot added a commit that referenced this issue Jul 3, 2019
1478: [WIP] Added resolve submodules with raw name r=matklad a=andreevlex

#1211

Co-authored-by: Alexander Andreev <[email protected]>
@ava57r
Copy link
Contributor

ava57r commented Jul 3, 2019

#[path] attributes where read docs?

@ava57r
Copy link
Contributor

ava57r commented Jul 6, 2019

after #1499 need more support #[path]

  • #[path ="./foo.rs"]
  • #[path ="../foo.rs"]
  • super module with #[path ="a"] and module #[path ="b.rs"]
  • super module with #[path ="a/b"] and module #[path ="c.rs"]
  • #[path ="bar\\baz\\foo.rs"]

bors bot added a commit that referenced this issue Jul 7, 2019
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 <[email protected]>
ava57r added a commit to ava57r/rust-analyzer that referenced this issue Jul 13, 2019
ava57r added a commit to ava57r/rust-analyzer that referenced this issue Jul 13, 2019
bors bot added a commit that referenced this issue Jul 14, 2019
1528: More resolution modules with attribute path r=matklad a=andreevlex

#1211

Co-authored-by: Alexander Andreev <[email protected]>
@ava57r
Copy link
Contributor

ava57r commented Jul 14, 2019

this issue complete.
Resolve path attributes continue in #1529

@matklad matklad closed this as completed Jul 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-easy E-has-instructions Issue has some instructions and pointers to code to get started good first issue
Projects
None yet
Development

No branches or pull requests

3 participants