Fork of daniellemaywood.uk/gleam — Wasm codegen work
2

Configure Feed

Select the types of activity you want to include in your feed.

Rename function

+11 -11
+3 -3
language-server/src/code_action.rs
··· 3683 3683 3684 3684 /// Converts the source start position of a documentation comment's contents into 3685 3685 /// the position of the leading slash in its marker ('///'). 3686 - fn get_doc_marker_pos(content_pos: u32) -> u32 { 3686 + fn get_doc_marker_position(content_pos: u32) -> u32 { 3687 3687 content_pos.saturating_sub(3) 3688 3688 } 3689 3689 ··· 3783 3783 // Here we need to get position of the function, starting from the leading slash in the 3784 3784 // documentation comment's marker ('///'), not from comment's content (of which 3785 3785 // we have the position), so we must convert the content start position 3786 - // to the leading slash's position using 'get_doc_marker_pos'. 3786 + // to the leading slash's position. 3787 3787 self.container_function_start = Some( 3788 3788 fun.documentation 3789 3789 .as_ref() 3790 - .map(|(doc_start, _)| get_doc_marker_pos(*doc_start)) 3790 + .map(|(doc_start, _)| get_doc_marker_position(*doc_start)) 3791 3791 .unwrap_or(fun_location.start), 3792 3792 ); 3793 3793
+8 -8
language-server/src/engine.rs
··· 491 491 // By convention, the symbol span starts from the leading slash in the 492 492 // documentation comment's marker ('///'), not from its content (of which 493 493 // we have the position), so we must convert the content start position 494 - // to the leading slash's position using 'get_doc_marker_pos'. 494 + // to the leading slash's position. 495 495 let full_function_span = SrcSpan { 496 496 start: function 497 497 .documentation 498 498 .as_ref() 499 - .map(|(doc_start, _)| get_doc_marker_pos(*doc_start)) 499 + .map(|(doc_start, _)| get_doc_marker_position(*doc_start)) 500 500 .unwrap_or(function.location.start), 501 501 502 502 end: function.end_position, ··· 531 531 for alias in &module.ast.definitions.type_aliases { 532 532 let full_alias_span = match alias.documentation { 533 533 Some((doc_position, _)) => { 534 - SrcSpan::new(get_doc_marker_pos(doc_position), alias.location.end) 534 + SrcSpan::new(get_doc_marker_position(doc_position), alias.location.end) 535 535 } 536 536 None => alias.location, 537 537 }; ··· 573 573 start: constant 574 574 .documentation 575 575 .as_ref() 576 - .map(|(doc_start, _)| get_doc_marker_pos(*doc_start)) 576 + .map(|(doc_start, _)| get_doc_marker_position(*doc_start)) 577 577 .unwrap_or(constant.location.start), 578 578 579 579 end: constant.value.location().end, ··· 1099 1099 1100 1100 let full_arg_span = match argument.doc { 1101 1101 Some((doc_position, _)) => { 1102 - SrcSpan::new(get_doc_marker_pos(doc_position), argument.location.end) 1102 + SrcSpan::new(get_doc_marker_position(doc_position), argument.location.end) 1103 1103 } 1104 1104 None => argument.location, 1105 1105 }; ··· 1131 1131 start: constructor 1132 1132 .documentation 1133 1133 .as_ref() 1134 - .map(|(doc_start, _)| get_doc_marker_pos(*doc_start)) 1134 + .map(|(doc_start, _)| get_doc_marker_position(*doc_start)) 1135 1135 .unwrap_or(constructor.location.start), 1136 1136 1137 1137 end: constructor.location.end, ··· 1170 1170 start: type_ 1171 1171 .documentation 1172 1172 .as_ref() 1173 - .map(|(doc_start, _)| get_doc_marker_pos(*doc_start)) 1173 + .map(|(doc_start, _)| get_doc_marker_position(*doc_start)) 1174 1174 .unwrap_or(type_.location.start), 1175 1175 1176 1176 end: type_.end_position, ··· 1648 1648 1649 1649 /// Converts the source start position of a documentation comment's contents into 1650 1650 /// the position of the leading slash in its marker ('///'). 1651 - fn get_doc_marker_pos(content_pos: u32) -> u32 { 1651 + fn get_doc_marker_position(content_pos: u32) -> u32 { 1652 1652 content_pos.saturating_sub(3) 1653 1653 } 1654 1654