diff options
| author | Lukas Wirth <lukastw97@gmail.com> | 2023-12-06 11:53:28 +0100 |
|---|---|---|
| committer | Lukas Wirth <lukastw97@gmail.com> | 2023-12-06 12:38:19 +0100 |
| commit | 9cb13b6efb2578dedb8521cf9442c56df50f8d0b (patch) | |
| tree | e5b17e99d80af30aadad784b86ddad75447af4e7 /crates/syntax | |
| parent | 9b7ec5e31be75ed49b2cc7f341fd93ca6999a303 (diff) | |
| download | rust-9cb13b6efb2578dedb8521cf9442c56df50f8d0b.tar.gz rust-9cb13b6efb2578dedb8521cf9442c56df50f8d0b.zip | |
Allow navigation targets to be duplicated when the focus range lies in the macro definition site
Diffstat (limited to 'crates/syntax')
| -rw-r--r-- | crates/syntax/src/ptr.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/crates/syntax/src/ptr.rs b/crates/syntax/src/ptr.rs index 71762996cd7..07641b203bb 100644 --- a/crates/syntax/src/ptr.rs +++ b/crates/syntax/src/ptr.rs @@ -22,12 +22,17 @@ use crate::{syntax_node::RustLanguage, AstNode, SyntaxNode}; pub type SyntaxNodePtr = rowan::ast::SyntaxNodePtr<RustLanguage>; /// Like `SyntaxNodePtr`, but remembers the type of node. -#[derive(Debug)] pub struct AstPtr<N: AstNode> { raw: SyntaxNodePtr, _ty: PhantomData<fn() -> N>, } +impl<N: AstNode + std::fmt::Debug> std::fmt::Debug for AstPtr<N> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.debug_tuple("AstPtr").field(&self.raw).finish() + } +} + impl<N: AstNode> Clone for AstPtr<N> { fn clone(&self) -> AstPtr<N> { AstPtr { raw: self.raw.clone(), _ty: PhantomData } |
