From a19b164661675be6a03cacfbc652cbd5f06492a0 Mon Sep 17 00:00:00 2001 From: veetaha Date: Sun, 10 May 2020 19:59:48 +0300 Subject: Correct path docs and add colon2 token to Path ast node --- crates/ra_syntax/src/ast/generated/nodes.rs | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'crates/ra_syntax') diff --git a/crates/ra_syntax/src/ast/generated/nodes.rs b/crates/ra_syntax/src/ast/generated/nodes.rs index a8360dfef..fc6733d64 100644 --- a/crates/ra_syntax/src/ast/generated/nodes.rs +++ b/crates/ra_syntax/src/ast/generated/nodes.rs @@ -2323,10 +2323,10 @@ impl ArgList { /// generic parameters. /// /// ``` -/// (0..10).❰ collect ❰ ::> ❱ ❱(); -/// ❰ Vec ❰ :: ❰ ::with_capacity ❱ ❱ ❱(1024); -/// ❰ ❰ ::baz ❱ ❱(); -/// ❰ ❰ ::bruuh ❱ ❱(); +/// (0..10).❰ ❰ collect ❱ ::> ❱(); +/// ❰ ❰ ❰ Vec ❱ :: ❱ ::with_capacity ❱(1024); +/// ❰ ❰ <❰ Foo ❱ as ❰ ❰ bar ❱ ::Bar ❱> ❱ ::baz ❱(); +/// ❰ ❰ <❰ bruh ❱> ❱ ::bruuh ❱(); /// ``` /// /// [Reference](https://doc.rust-lang.org/reference/paths.html) @@ -2336,15 +2336,21 @@ pub struct Path { } impl Path { pub fn segment(&self) -> Option { support::child(&self.syntax) } + pub fn coloncolon_token(&self) -> Option { support::token(&self.syntax, T![::]) } pub fn qualifier(&self) -> Option { support::child(&self.syntax) } } /// Segment of the path to a symbol. +/// Only path segment of an absolute path holds the `::` token, +/// all other `::` tokens that connect path segments reside under `Path` itself.` /// /// ``` -/// (0..10).❰ collect ❱ ❰ ::> ❱(); -/// ❰ Vec >| ❰ :: ❱ ❰ ::with_capacity ❱(1024); -/// ❰ ❱ ❰ ::baz ❱(); -/// ❰ ❱ ❰ ::bruuh ❱(); +/// (0..10).❰ collect ❱ :: ❰ > ❱(); +/// ❰ Vec ❱ :: ❰ ❱ :: ❰ with_capacity ❱(1024); +/// ❰ <❰ Foo ❱ as ❰ bar ❱ :: ❰ Bar ❱> ❱ :: ❰ baz ❱(); +/// ❰ <❰ bruh ❱> ❱ :: ❰ bruuh ❱(); +/// +/// // Note that only in this case `::` token is inlcuded: +/// ❰ ::foo ❱; /// ``` /// /// [Reference](https://doc.rust-lang.org/reference/paths.html) -- cgit v1.2.3