mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-17 15:55:23 +00:00
Hash based on binding name and shadow counter
This commit is contained in:
parent
5bf3e949e8
commit
ed89b0638b
4 changed files with 81 additions and 21 deletions
|
@ -1,6 +1,6 @@
|
|||
use std::{fmt, ops::{self, Bound}};
|
||||
|
||||
use crate::{SyntaxNode, TextRange, TextUnit, SyntaxElement};
|
||||
use crate::{SmolStr, SyntaxNode, TextRange, TextUnit, SyntaxElement};
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct SyntaxText<'a> {
|
||||
|
@ -34,6 +34,11 @@ impl<'a> SyntaxText<'a> {
|
|||
self.chunks().collect()
|
||||
}
|
||||
|
||||
pub fn to_smol_string(&self) -> SmolStr {
|
||||
// TODO: `impl iter::FromIterator<&str> for SmolStr`
|
||||
self.to_string().into()
|
||||
}
|
||||
|
||||
pub fn contains(&self, c: char) -> bool {
|
||||
self.chunks().any(|it| it.contains(c))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue