File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -72,6 +72,11 @@ impl ImportScope {
7272 if is_inner_node ( maybe_inner_node. clone ( ) ) {
7373 last_inner_element = Some ( NodeOrToken :: Node ( maybe_inner_node) )
7474 } else {
75+ // FIXME: https://doc.rust-lang.org/reference/comments.html#doc-comments
76+ // states that inner comments (`//!` and `/*!`) are equal to inner attribute `#![doc="..."]`
77+ // yet RA treats them differently now: inner attributes never belong to child nodes,
78+ // but inner comments can, ergo this check.
79+ // We need to align this and treat both cases the same way.
7580 if let Some ( maybe_inner_token) = maybe_inner_node. first_token ( ) {
7681 if is_inner_token ( maybe_inner_token. clone ( ) ) {
7782 last_inner_element = Some ( NodeOrToken :: Token ( maybe_inner_token) )
@@ -877,11 +882,11 @@ use foo::bar::Baz;"#,
877882 "foo::bar::Baz" ,
878883 r#"/*! Multiline inner comments do not allow any code before them. */
879884
880- /*! RA considers this inner comment belonging to the function, yet we still cannot place the code before it . */
885+ /*! Still an inner comment, cannot place any code before. */
881886fn main() {}"# ,
882887 r#"/*! Multiline inner comments do not allow any code before them. */
883888
884- /*! RA considers this inner comment belonging to the function, yet we still cannot place the code before it . */
889+ /*! Still an inner comment, cannot place any code before. */
885890
886891use foo::bar::Baz;
887892fn main() {}"# ,
You can’t perform that action at this time.
0 commit comments