Skip to content

Conversation

@edwin0cheng
Copy link
Contributor

There are some panic when hover/goto definition for proc-macro. It is because in current design, we don't have ast-node for proc-macro and then it trigger this line to panic.

This PR is a temp fix for all of these similar to https://github.com/rust-analyzer/rust-analyzer/blob/bd4c352831662762ee7a66da77ec9adf623b0a0a/crates/completion/src/render/macro_.rs#L42

@matklad
Copy link
Contributor

matklad commented Dec 17, 2020

Let's update fixmes to include links to #6913. Other than that, r=me!

@edwin0cheng edwin0cheng force-pushed the temp-fix-has-source-proc-macro branch from 238f40c to c1c36ac Compare December 18, 2020 02:26
@edwin0cheng edwin0cheng reopened this Dec 18, 2020
@edwin0cheng
Copy link
Contributor Author

bors r=maklad

@bors
Copy link
Contributor

bors bot commented Dec 18, 2020

@bors bors bot merged commit f4929fa into rust-lang:master Dec 18, 2020
@edwin0cheng edwin0cheng deleted the temp-fix-has-source-proc-macro branch December 20, 2020 05:09
nick96 added a commit to nick96/rust-analyzer that referenced this pull request Jan 1, 2021
…os were special cased

In rust-lang#6901 some special case handling for proc-macros was introduced to
prevent panicing as they have no AST. Now the new HasSource::source
method is used that returns an option.

Generally this was a pretty trivial change, the only thing of much
interest is that `hir::MacroDef` now implements `TryToNav` not `ToNav`
as this allows us to handle `HasSource::source` now returning an option.
nick96 added a commit to nick96/rust-analyzer that referenced this pull request Jan 2, 2021
…os were special cased

In rust-lang#6901 some special case handling for proc-macros was introduced to
prevent panicing as they have no AST. Now the new HasSource::source
method is used that returns an option.

Generally this was a pretty trivial change, the only thing of much
interest is that `hir::MacroDef` now implements `TryToNav` not `ToNav`
as this allows us to handle `HasSource::source` now returning an option.
ivan770 pushed a commit to ivan770/rust-analyzer that referenced this pull request Jan 22, 2021
…os were special cased

In rust-lang#6901 some special case handling for proc-macros was introduced to
prevent panicing as they have no AST. Now the new HasSource::source
method is used that returns an option.

Generally this was a pretty trivial change, the only thing of much
interest is that `hir::MacroDef` now implements `TryToNav` not `ToNav`
as this allows us to handle `HasSource::source` now returning an option.
Matthias-Fauconneau pushed a commit to Matthias-Fauconneau/rust-analyzer that referenced this pull request Feb 7, 2021
…os were special cased

In rust-lang#6901 some special case handling for proc-macros was introduced to
prevent panicing as they have no AST. Now the new HasSource::source
method is used that returns an option.

Generally this was a pretty trivial change, the only thing of much
interest is that `hir::MacroDef` now implements `TryToNav` not `ToNav`
as this allows us to handle `HasSource::source` now returning an option.
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

Successfully merging this pull request may close these issues.

2 participants