diff options
author | Aleksey Kladov <[email protected]> | 2019-11-24 14:34:36 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-11-24 14:36:06 +0000 |
commit | 21cfa6d529babf868f897b943d67561ea752b9e5 (patch) | |
tree | bb4e9795f9dc23d710f147faff02e9d8df596d87 | |
parent | 99af523b68d3056c0ee355821b9b8f3c6fb5f504 (diff) |
Some docs
-rw-r--r-- | crates/ra_hir_def/src/data.rs | 15 | ||||
-rw-r--r-- | crates/ra_hir_def/src/docs.rs | 5 | ||||
-rw-r--r-- | crates/ra_hir_def/src/nameres/raw.rs | 7 | ||||
-rw-r--r-- | crates/ra_hir_def/src/path.rs | 2 |
4 files changed, 18 insertions, 11 deletions
diff --git a/crates/ra_hir_def/src/data.rs b/crates/ra_hir_def/src/data.rs index 81a8ec18d..68bea34df 100644 --- a/crates/ra_hir_def/src/data.rs +++ b/crates/ra_hir_def/src/data.rs | |||
@@ -200,18 +200,17 @@ pub struct ConstData { | |||
200 | impl ConstData { | 200 | impl ConstData { |
201 | pub(crate) fn const_data_query(db: &impl DefDatabase, konst: ConstId) -> Arc<ConstData> { | 201 | pub(crate) fn const_data_query(db: &impl DefDatabase, konst: ConstId) -> Arc<ConstData> { |
202 | let node = konst.lookup(db).source(db).value; | 202 | let node = konst.lookup(db).source(db).value; |
203 | const_data_for(&node) | 203 | Arc::new(ConstData::new(&node)) |
204 | } | 204 | } |
205 | 205 | ||
206 | pub(crate) fn static_data_query(db: &impl DefDatabase, konst: StaticId) -> Arc<ConstData> { | 206 | pub(crate) fn static_data_query(db: &impl DefDatabase, konst: StaticId) -> Arc<ConstData> { |
207 | let node = konst.lookup(db).source(db).value; | 207 | let node = konst.lookup(db).source(db).value; |
208 | const_data_for(&node) | 208 | Arc::new(ConstData::new(&node)) |
209 | } | 209 | } |
210 | } | ||
211 | 210 | ||
212 | fn const_data_for<N: NameOwner + TypeAscriptionOwner>(node: &N) -> Arc<ConstData> { | 211 | fn new<N: NameOwner + TypeAscriptionOwner>(node: &N) -> ConstData { |
213 | let name = node.name().map(|n| n.as_name()); | 212 | let name = node.name().map(|n| n.as_name()); |
214 | let type_ref = TypeRef::from_ast_opt(node.ascribed_type()); | 213 | let type_ref = TypeRef::from_ast_opt(node.ascribed_type()); |
215 | let sig = ConstData { name, type_ref }; | 214 | ConstData { name, type_ref } |
216 | Arc::new(sig) | 215 | } |
217 | } | 216 | } |
diff --git a/crates/ra_hir_def/src/docs.rs b/crates/ra_hir_def/src/docs.rs index 225511428..90a8627bc 100644 --- a/crates/ra_hir_def/src/docs.rs +++ b/crates/ra_hir_def/src/docs.rs | |||
@@ -1,4 +1,7 @@ | |||
1 | //! FIXME: write short doc here | 1 | //! Defines hir documentation. |
2 | //! | ||
3 | //! This really shouldn't exist, instead, we should deshugar doc comments into attributes, see | ||
4 | //! https://github.com/rust-analyzer/rust-analyzer/issues/2148#issuecomment-550519102 | ||
2 | 5 | ||
3 | use std::sync::Arc; | 6 | use std::sync::Arc; |
4 | 7 | ||
diff --git a/crates/ra_hir_def/src/nameres/raw.rs b/crates/ra_hir_def/src/nameres/raw.rs index 198578753..2ec84f2cc 100644 --- a/crates/ra_hir_def/src/nameres/raw.rs +++ b/crates/ra_hir_def/src/nameres/raw.rs | |||
@@ -1,4 +1,9 @@ | |||
1 | //! FIXME: write short doc here | 1 | //! Lowers syntax tree of a rust file into a raw representation of containing |
2 | //! items, *without* attaching them to a module structure. | ||
3 | //! | ||
4 | //! That is, raw items don't have semantics, just as syntax, but, unlike syntax, | ||
5 | //! they don't change with trivial source code edits, making them a great tool | ||
6 | //! for building salsa recomputation firewalls. | ||
2 | 7 | ||
3 | use std::{ops::Index, sync::Arc}; | 8 | use std::{ops::Index, sync::Arc}; |
4 | 9 | ||
diff --git a/crates/ra_hir_def/src/path.rs b/crates/ra_hir_def/src/path.rs index 94f6a27bc..7b2723d57 100644 --- a/crates/ra_hir_def/src/path.rs +++ b/crates/ra_hir_def/src/path.rs | |||
@@ -1,4 +1,4 @@ | |||
1 | //! FIXME: write short doc here | 1 | //! A desugared representation of paths like `crate::foo` or `<Type as Trait>::bar`. |
2 | 2 | ||
3 | use std::{iter, sync::Arc}; | 3 | use std::{iter, sync::Arc}; |
4 | 4 | ||