Add more docs

This commit is contained in:
Aleksey Kladov 2021-05-22 16:53:47 +03:00
parent e6776c3e1b
commit 188b0f96f9
20 changed files with 72 additions and 40 deletions

View file

@ -1,4 +1,13 @@
//! FIXME: write short doc here
//! In rust-analyzer, syntax trees are transient objects.
//!
//! That means that we create trees when we need them, and tear them down to
//! save memory. In this architecture, hanging on to a particular syntax node
//! for a long time is ill-advisable, as that keeps the whole tree resident.
//!
//! Instead, we provide a [`SyntaxNodePtr`] type, which stores information about
//! *location* of a particular syntax node in a tree. Its a small type which can
//! be cheaply stored, and which can be resolved to a real [`SyntaxNode`] when
//! necessary.
use std::{
hash::{Hash, Hasher},