Skip to content

Commit

Permalink
Fix preferred order of constructors and builder
Browse files Browse the repository at this point in the history
methods in render function
  • Loading branch information
mustakimali committed Dec 13, 2023
1 parent 2a05fcc commit bd062c7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions crates/ide-completion/src/render/function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,12 @@ fn render(
item
}

/// When typing `::` of a type, the preferred orderer is:
/// When typing `::` of a type, the preferred order is:
/// * Constructors: new like functions to be able to create the type,
/// * Constructors that take args: Any other function that creates Self
/// * Builder Methods: any builder methods available
/// * Regular methods
/// * Regular methods & Associated functions
///
fn calculate_bonus(ctx: &RenderContext<'_>, func: hir::Function, db: &dyn HirDatabase) -> u32 {
if ctx.token().kind() != syntax::SyntaxKind::COLON2 || func.self_param(db).is_some() {
return 0;
Expand Down

0 comments on commit bd062c7

Please sign in to comment.