Skip to content

Commit

Permalink
fix wrong ordering of parameters in hover
Browse files Browse the repository at this point in the history
  • Loading branch information
SpontanCombust committed May 21, 2024
1 parent 4a76cff commit 9134441
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions crates/lsp/src/providers/hover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -322,10 +322,11 @@ impl RenderTooltip for GlobalFunctionSymbol {

params.sort_by(|param1, param2| param1.ordinal.cmp(&param2.ordinal));

if let Some(param) = params.pop() {
let mut params_iter = params.into_iter();
if let Some(param) = params_iter.next() {
param.render(buf, symtab);
}
for param in params {
for param in params_iter {
buf.push_str(", ");
param.render(buf, symtab);
}
Expand Down Expand Up @@ -396,10 +397,11 @@ impl RenderTooltip for MemberFunctionSymbol {

params.sort_by(|param1, param2| param1.ordinal.cmp(&param2.ordinal));

if let Some(param) = params.pop() {
let mut params_iter = params.into_iter();
if let Some(param) = params_iter.next() {
param.render(buf, symtab);
}
for param in params {
for param in params_iter {
buf.push_str(", ");
param.render(buf, symtab);
}
Expand Down Expand Up @@ -457,10 +459,11 @@ impl RenderTooltip for EventSymbol {

params.sort_by(|param1, param2| param1.ordinal.cmp(&param2.ordinal));

if let Some(param) = params.pop() {
let mut params_iter = params.into_iter();
if let Some(param) = params_iter.next() {
param.render(buf, symtab);
}
for param in params {
for param in params_iter {
buf.push_str(", ");
param.render(buf, symtab);
}
Expand Down

0 comments on commit 9134441

Please sign in to comment.