Skip to content

Commit

Permalink
docs(semantic): correct docs for Reference
Browse files Browse the repository at this point in the history
  • Loading branch information
overlookmotel committed Sep 23, 2024
1 parent 0a2f687 commit 08a1756
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions crates/oxc_semantic/src/reference.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,16 @@ use crate::{symbol::SymbolId, NodeId};
/// populated. [`None`] indicates that either a global variable or a
/// non-existent symbol is being referenced.
///
/// In most cases, the node identified by `node_id` will be an
/// [`IdentifierReference`], but it could be some special reference type like a
/// [`JSXIdentifier`]. Note that declarations do not count as references, even
/// if the declaration is being used in an expression.
/// The node identified by `node_id` will be an [`IdentifierReference`].
/// Note that declarations do not count as references, even if the declaration
/// is being used in an expression.
///
/// ```ts
/// const arr = [1, 2, 3].map(function mapper(x) { return x + 1; });
/// // Not considered a reference ^^^^^^
/// ```
///
/// [`IdentifierReference`]: oxc_ast::ast::IdentifierReference
/// [`JSXIdentifier`]: oxc_ast::ast::JSXIdentifier
#[derive(Debug, Clone)]
#[cfg_attr(feature = "serialize", derive(Serialize, Tsify))]
#[cfg_attr(feature = "serialize", serde(rename_all = "camelCase"))]
Expand Down

0 comments on commit 08a1756

Please sign in to comment.