mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 04:19:13 +00:00
Allow navigation targets to be duplicated when the focus range lies in the macro definition site
This commit is contained in:
parent
9b7ec5e31b
commit
9cb13b6efb
38 changed files with 851 additions and 488 deletions
|
@ -60,11 +60,21 @@ pub use paths::{AbsPath, AbsPathBuf};
|
|||
///
|
||||
/// Most functions in rust-analyzer use this when they need to refer to a file.
|
||||
#[derive(Copy, Clone, Debug, Ord, PartialOrd, Eq, PartialEq, Hash)]
|
||||
pub struct FileId(pub u32);
|
||||
pub struct FileId(u32);
|
||||
|
||||
impl FileId {
|
||||
/// Think twice about using this outside of tests. If this ends up in a wrong place it will cause panics!
|
||||
pub const BOGUS: FileId = FileId(u32::MAX);
|
||||
pub const BOGUS: FileId = FileId(0xe4e4e);
|
||||
|
||||
#[inline]
|
||||
pub fn from_raw(raw: u32) -> FileId {
|
||||
FileId(raw)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn index(self) -> u32 {
|
||||
self.0
|
||||
}
|
||||
}
|
||||
|
||||
/// safe because `FileId` is a newtype of `u32`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue