mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 20:42:04 +00:00
chore: fix some comments
Signed-off-by: cuishuang <imcusg@gmail.com>
This commit is contained in:
parent
779d9eee2e
commit
680de15ec3
4 changed files with 4 additions and 4 deletions
|
@ -281,7 +281,7 @@ impl SourceToDefCtx<'_, '_> {
|
||||||
let (body, source_map) = self.db.body_with_source_map(container);
|
let (body, source_map) = self.db.body_with_source_map(container);
|
||||||
let src = src.cloned().map(ast::Pat::from);
|
let src = src.cloned().map(ast::Pat::from);
|
||||||
let pat_id = source_map.node_pat(src.as_ref())?;
|
let pat_id = source_map.node_pat(src.as_ref())?;
|
||||||
// the pattern could resolve to a constant, verify that that is not the case
|
// the pattern could resolve to a constant, verify that this is not the case
|
||||||
if let crate::Pat::Bind { id, .. } = body[pat_id] {
|
if let crate::Pat::Bind { id, .. } = body[pat_id] {
|
||||||
Some((container, id))
|
Some((container, id))
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -15,7 +15,7 @@ macro_rules! define_symbols {
|
||||||
(@WITH_NAME: $($alias:ident = $value:literal,)* @PLAIN: $($name:ident,)*) => {
|
(@WITH_NAME: $($alias:ident = $value:literal,)* @PLAIN: $($name:ident,)*) => {
|
||||||
// Ideally we would be emitting `const` here, but then we no longer have stable addresses
|
// Ideally we would be emitting `const` here, but then we no longer have stable addresses
|
||||||
// which is what we are relying on for equality! In the future if consts can refer to
|
// which is what we are relying on for equality! In the future if consts can refer to
|
||||||
// statics we should swap these for `const`s and have the the string literal being pointed
|
// statics we should swap these for `const`s and have the string literal being pointed
|
||||||
// to be statics to refer to such that their address is stable.
|
// to be statics to refer to such that their address is stable.
|
||||||
$(
|
$(
|
||||||
pub static $name: Symbol = Symbol { repr: TaggedArcPtr::non_arc(&stringify!($name)) };
|
pub static $name: Symbol = Symbol { repr: TaggedArcPtr::non_arc(&stringify!($name)) };
|
||||||
|
|
|
@ -142,7 +142,7 @@ impl flags::Scip {
|
||||||
let mut symbol_roles = Default::default();
|
let mut symbol_roles = Default::default();
|
||||||
|
|
||||||
if let Some(def) = token.definition {
|
if let Some(def) = token.definition {
|
||||||
// if the the range of the def and the range of the token are the same, this must be the definition.
|
// if the range of the def and the range of the token are the same, this must be the definition.
|
||||||
// they also must be in the same file. See https://github.com/rust-lang/rust-analyzer/pull/17988
|
// they also must be in the same file. See https://github.com/rust-lang/rust-analyzer/pull/17988
|
||||||
if def.file_id == file_id && def.range == text_range {
|
if def.file_id == file_id && def.range == text_range {
|
||||||
symbol_roles |= scip_types::SymbolRole::Definition as i32;
|
symbol_roles |= scip_types::SymbolRole::Definition as i32;
|
||||||
|
|
|
@ -81,7 +81,7 @@ pub struct SyntaxContextData {
|
||||||
/// Invariant: Only [`SyntaxContextId::ROOT`] has a [`None`] outer expansion.
|
/// Invariant: Only [`SyntaxContextId::ROOT`] has a [`None`] outer expansion.
|
||||||
// FIXME: The None case needs to encode the context crate id. We can encode that as the MSB of
|
// FIXME: The None case needs to encode the context crate id. We can encode that as the MSB of
|
||||||
// MacroCallId is reserved anyways so we can do bit tagging here just fine.
|
// MacroCallId is reserved anyways so we can do bit tagging here just fine.
|
||||||
// The bigger issue is that that will cause interning to now create completely separate chains
|
// The bigger issue is that this will cause interning to now create completely separate chains
|
||||||
// per crate. Though that is likely not a problem as `MacroCallId`s are already crate calling dependent.
|
// per crate. Though that is likely not a problem as `MacroCallId`s are already crate calling dependent.
|
||||||
pub outer_expn: Option<MacroCallId>,
|
pub outer_expn: Option<MacroCallId>,
|
||||||
pub outer_transparency: Transparency,
|
pub outer_transparency: Transparency,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue